Java Thread - 2
来源:互联网 发布:网络胜利组漫画版权 编辑:程序博客网 时间:2024/05/20 16:40
package com;
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
// try {
// Thread.sleep(5000);
// } catch (InterruptedException e) {
//
// e.printStackTrace();
// }
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
// try {
// Thread.sleep(5000);
// } catch (InterruptedException e) {
//
// e.printStackTrace();
// }
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
1211852076125
1211852076125
main HaHa
Thread-0 ByeBye
package com;
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
// try {
// Thread.sleep(5000);
// } catch (InterruptedException e) {
//
// e.printStackTrace();
// }
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
// try {
// Thread.sleep(5000);
// } catch (InterruptedException e) {
//
// e.printStackTrace();
// }
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
1211852205906
Thread-0 ByeBye
1211852210906
main HaHa
package com;
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
public class Test implements Runnable ...{
public static void main(String[] args) ...{
Test test = new Test();
Thread thread = new Thread(test);
thread.start();
System.out.println(System.currentTimeMillis());
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(System.currentTimeMillis());
System.out.println(Thread.currentThread().getName() + " HaHa");
}
}
public void run() ...{
try ...{
Thread.sleep(5000);
} catch (InterruptedException e) ...{
e.printStackTrace();
}
//for (;;)
...{
System.out.println(Thread.currentThread().getName() + " ByeBye");
}
}
}
1211852246312
1211852251312
main HaHa
Thread-0 ByeBye
- Java Thread - 2
- java Thread(2)
- java多线程 Thread 2
- Java Thread Programming 1.8.2 - Inter-thread Communication
- Thread & Java
- Java Thread
- java Thread
- Java Thread
- Java Thread
- java thread
- Java Thread
- Java Thread
- Java Thread
- java thread
- Java Thread
- java thread
- java thread
- java Thread
- 如何设置sources.list
- JSP中访问数据库大全
- Yahoo! 的数据仓库:世界上最大最忙
- 智能化网络管理系统 为网络安全把脉
- 译稿:IBM的虚拟全球办公室
- Java Thread - 2
- VB.NET CONTROL MICROSOFT PROJECT
- spring 的优点
- Fifty Habits of Highly Successful People
- windows系统端口监听
- SAP F4 function sample
- C# 多线程与异步操作实现的探讨(推荐)
- 如何有序的存储资料?
- 4+1视图模型概况