null pointer on String
Don French
Posts: 126
I get an NPE in the String class. Not sure what causes this or how to fix it. It kind of looks like a Javelin bug. One other question, when trying to debug the code, it tells me that there are no line numbers in one of my classes. Is there a switch I have to set to get line numbers, or what?
Comments
public class ClassA {
static ClassB rf = new ClassB(1, 2);
public static void main(){
return;
}
and I changed it to code like this:
public class ClassA {
static ClassB rf;
public static void main(){
rf = new ClassB(1, 2);
return;
}
and the NPE went away. Why is this?
Moving the creation of a new classB into main() made the
error disappear because main() only gets to run after
the initialization of all used classes is done.
Without seeing the actual classes used, that is my best guess.
If you use debug instead of just program, you can single step
your code and it will show a call/stack trace.
regards peter
Regards