Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic array

 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am creating dynamic array

I got null pointer exception


String [][] a = null ;
a[0][0]="hi";

how can i create dynamic array
 
Campbell Ritchie
Sheriff
Pie
Posts: 49411
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a dynamic array?

You have initialised your array to null and tried to use it. No wonder you have a NullPointerException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic