Java基础进阶案例教程(课件)例7-1.docxVIP

  • 5
  • 0
  • 约小于1千字
  • 约 3页
  • 2018-12-28 发布于江西
  • 举报
class ThreadList extends Thread { private String key; public void run() { for(int i=0;i20;i++) { for(int j=0; j5; j++) { System.out.print(Thread.currentThread().getName()+key); System.out.print( ); } System.out.println(); } } public ThreadList(String key) { super(); this.key=key; } } public class Example7_1 { public static void main(String[] args) { ThreadList t0=new ThreadList(T0); ThreadList t1=new ThreadList(T1); ThreadList t2=new ThreadList(T2); t0.start(); t1.start(); t2.start(); } }

文档评论(0)

1亿VIP精品文档

相关文档