public class Test{
public static void main(String[] args) {
System.out.println(new A());
}
}
class A{
@Override
public String toString() {
return "hello"+toString();
}
}
自己调自己,而且没有退出条件,发生堆栈溢出,方法调用栈
标签:String,StackOverflowError,public,class,toString,阅读,代码 From: https://www.cnblogs.com/yaocy/p/16740932.html