This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Problem in appending data to array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in appending data to array" Watch "Problem in appending data to array" New topic
Author

Problem in appending data to array

preethi balaJain
Greenhorn

Joined: Sep 01, 2009
Posts: 6
I tried to use 3 dimensional array(because i need data heirarchy).I can not able to add data to the array.I'm getting null pointer exception.Can anyone help me.Is there any other better way to do it?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183


The last dimension needs to be initialized too ...


JDBCSupport - An easy to use, light-weight JDBC framework -
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

preethi balaJain wrote:... I'm getting null pointer exception...

How does this compile with the incompatible types? "test_new" is declared as a 3-dimensional String array. But then a new 3-dimensional Rectangle array is created and assigned to test_new.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
wood burning stoves
 
subject: Problem in appending data to array