samedi 16 juillet 2016

Verstehe die NullPointerException nicht

samedi 16 juillet 2016
Kann mir jemand nachvollziehbar erklären, warum und wieso es im nachstehenden Code zu einer NullPointerException kommt?
Code (Text):
public class blaablaa {
    public static void main(String[] args) {
        ClassA a = new ClassA();
        a.methodA();
    }
}
class ClassA {
    public void methodA() {
         ClassB classB = new ClassB();
         classB.getValue();
    }
}
class ClassB {
    public ClassC classC;
    public String getValue() {
         return classC.getValue();
    }
}
class...
Verstehe die NullPointerException nicht

Verstehe die NullPointerException nicht

0 commentaires:

Enregistrer un commentaire

 
◄Design by Pocket