File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in appending data to array" Watch "Problem in appending data to array" New topic

Problem in appending data to array

preethi balaJain

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

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
It is sorta covered in the JavaRanch Style Guide.
subject: Problem in appending data to array
jQuery in Action, 3rd edition