Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

NullPointerExcepton why

 
ali pak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Report post to moderator
// 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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic