阅读下面的程序,请将程序补充完整。Public class Test ( ){ //继承线程类 static int total=10; int n; public Test(int n){ this.n=n;} public void run(){Try{( );//休眠n毫秒 total+=n; System.out.println(total); }Catch(Exception e) {}} public static void main(String args]){ Test t=new Test (5000); ( ); //启动线程t} }
发布时间:2024-05-21 21:24:49