- 博客(2)
- 收藏
- 关注
原创 java isInterrupted()和interrupted()
1 线程调用interrupt()后,去中断线程 2 线程调用isInterrupted()和interrupted()判断线程是否被中断,中断返回true public static boolean interrupted() { return currentThread().isInterrupted(true); } public boolean isInterrupted() {
2017-03-03 17:47:19 757
原创 java中线程常用的方法
1. java如何实现一个多线程 (1) 继承Thread start()方法开启一个线程 (2) 实现Runnable run()方法执行线程内容 Thread(Runnable) 2. 线程常用方法 a) currentThread() 在线程Thread1中调用该方法返回当前线程名字是thread1,在main方法中运行 thread1.sta
2017-03-03 17:45:17 559
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人