http://blog.csdn.net/itpinpai/article/details/8462436
分类:
- class MyThead implements Runnable
- {
- public void run()
- {
- System.out.println("我休息了!");
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e)
- {
- System.out.println("啊,这么早就把我叫起来了!");
- }
- }
- }
-
- public class TheadMain
- {
- public static void main(String[] args)
- {
- MyThead myThead = new MyThead();
- Thread thread = new Thread(myThead);
- thread.start();
- thread.interrupt();
- }
- }