1
爲什麼這段代碼不能正常執行。它拋出java.lang.StackOverflowError。我想知道這個班的行爲。爲什麼這段代碼拋出java.lang.StackOverflowError
public class A {
A a = new A();
public static void main(String[] args) {
A a = new A();
System.out.println("i'm done!");
}}
http://stackoverflow.com/questions/214741/what-is-a-stackoverflowerror –
你應該學會使用調試器,然後你會看到明顯的問題。 –