なぜコードがNULLポインタ例外をスローするのですか? 'this'を使用する意味は何ですか?私は初心者です、何か助けを大切にしてください。次の文脈でキーワード 'this'を使用する意味
// class Foobar
private Foo f;
void get(){
this.getFoo().handle();
}
public Foolish getFoo(){
return this.f;
}
void handle(){
System.out.println("handle of the intrf");
}
// please note that
public interface Foolish {
void handle();
}
//main
public static void main(String[] args) {
new Foobar().get();
どのラインが投げていますか? – JaredPar
???完全なスタックトレースを投稿してください。 – m0skit0
完全なスタックトレースを表示してください – amit