• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

null pointer exception

 
Muhammad usman shad
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No error when compile it,
But it does not execute!!!
What is the solution???
 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initializing_Array[] ia = new Initializing_Array[10];


You have created 10 reference of type Initializing_Array
It doesnt mean 10 objects of Initializing_Array.

So you have to create Object and assign to these refence, then only you able to set the values.

like

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic