![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
j2se
独孤残存
这个作者很懒,什么都没留下…
展开
-
关于使用多个 catch 语句捕获多个异常问题
public class MyException extends Exception{ } public class MyException2 extends MyException{ } public class ExceptionTest { public static void main(String[] args) { try { throw new MyExcep原创 2014-03-26 17:57:36 · 2917 阅读 · 0 评论 -
内置锁是可重入的,所以在同一个线程重复加锁内不会造成死锁
package com.zhongmingjun.demo_3; public class SynchronziedAndDataDemo_0 { public static void main(String[] args) { MyThread m1=new MyThread(); Thread t1=new Thread(m1); Thread t2=new Thre原创 2015-04-05 17:52:42 · 1093 阅读 · 0 评论 -
异步调用及回调
package com.zhongmingjun.demo_1; public class AsynchronousCallDemo_0 { public static void main(String[] args) { Employee em=new Employee(); Boss boss=new Boss(em); boss.assignWorks(); } }原创 2015-04-06 17:37:34 · 289 阅读 · 0 评论 -
获取当前jvm下的所有线程
ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); Thread[] threads = new Thread[threadGroup.activeCount()]; threadGroup.enumerate(threads); for (Thread thread原创 2015-10-02 16:28:51 · 658 阅读 · 0 评论