File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes NullPointerExcepton why Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

NullPointerExcepton why

ali pak
Greenhorn

Joined: Nov 24, 2001
Posts: 6
// whats wrong with this code, i am getting an exception
// NullPointerException
class a
{
public static void main(String[] args)
{
b[] x = new b[5];
x[0].xx = "ali";
System.out.println(x[0].xx);
}
}
class b
{
String xx;
}
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
I bet if someone answers here they will give the same answer that was given in the beginner forum Please don't post the same question in multiple forums. Give people a chance to answer them.
 
 
subject: NullPointerExcepton why
 
Similar Threads
Greedy Quantifier + !!
How to make all my graphics selectable and doubleclick with event?
whats wrong with this code
null pointer exception
explain the code output