public class test {
public static void main(String Args[]){
cls [] arr = new cls [10];
arr[0].m=2; // line8 is this :)
arr[0].n="b";
}
}
class cls{
int m; String n;
public cls(){
m=1;
n="a";
}
}
ERROR
[COLOR="#B22222"]Exception in thread "main" java.lang.NullPointerException at test.main(test.java:8) [/COLOR]
could you tell me, what mistakes do I have, please?


Sign In
Create Account


Back to top









