File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

NullPointerExcepton why

ali pak

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";
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.
I agree. Here's the link:
subject: NullPointerExcepton why
It's not a secret anymore!