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 null pointer exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "null pointer exception" Watch "null pointer exception" New topic

null pointer exception

Muhammad usman shad
Ranch Hand

Joined: Jan 06, 2010
Posts: 30
No error when compile it,
But it does not execute!!!
What is the solution???
sujith Acharya
Ranch Hand

Joined: Dec 25, 2006
Posts: 60
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.


I agree. Here's the link:
subject: null pointer exception
It's not a secret anymore!