File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in appending data to array

 
preethi balaJain
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The last dimension needs to be initialized too ...
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic