2Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

public class TestException {
    public static void main(String[] args) {
        String str = "1";
        for(int i=0;i<10000;i++) {
            str += str;
        }
    }
}

 

posted @ 2017-06-28 23:36  zhuangrunwei  阅读(150)  评论(0编辑  收藏  举报