码迷,mamicode.com
首页 > 其他好文 > 详细

一段带着毒性的代码

时间:2018-05-03 19:53:32      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:except   dex   try   main   interrupt   extends   cep   int   daemon   

import java.util.concurrent.CountDownLatch;
public class TestNativeOutOfMemoryError {
public static void main(String[] args) {
for (int i = 0;; i++) {
System.out.println("i = " + i);
new Thread(new HoldThread()).start();
}
}
}
class HoldThread extends Thread {
CountDownLatch cdl = new CountDownLatch(1);
public HoldThread() {
this.setDaemon(true);
}
public void run() {
try {
cdl.await();
} catch (InterruptedException e) {
}
}
}

一段带着毒性的代码

标签:except   dex   try   main   interrupt   extends   cep   int   daemon   

原文地址:https://www.cnblogs.com/JJJ1990/p/8986773.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!