1 Star 0 Fork 2

Wings/JavaProgramming

forked from tzhanggit/JavaProgramming 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
TestInterrupt.java 576 Bytes
Copy Edit Raw Blame History
TZhangOffice authored 2020-06-06 16:20 +08:00 . 2020春代码更新完毕
package ch9;
import java.util.Date;
/**
* 2Interrupt
*/
public class TestInterrupt {
public static void main(String[] args) {
MyThread t = new MyThread();
t.start();
try {
Thread.sleep(10000);
} catch(InterruptedException e) {
}
t.stop();
}
}
class MyThread extends Thread { // implements Runnable
public void run() {
while (true)
{
System.out.println("===" + new Date() + "===");
try {
sleep(1000);
} catch (InterruptedException e) {
System.out.println("Hello");
return;
} finally {
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/wingszeng/JavaProgramming.git
git@gitee.com:wingszeng/JavaProgramming.git
wingszeng
JavaProgramming
JavaProgramming
master

Search