public class test
{
public static void main(String[] args) {
test t1 = new test2();
test t2 = new test2();
t1.methodName(0);
t2.methodName(2);
} public void methodName( int i ){
try{
if( i == 0 ){
Thread.sleep(10000);
}
System.out.println( i );
}catch(Exception e){
}
}
}想用不同的线程extends thread 开多线程好了
{
public static void main(String[] args) {
test t1 = new test2();
test t2 = new test2();
t1.methodName(0);
t2.methodName(2);
} public void methodName( int i ){
try{
if( i == 0 ){
Thread.sleep(10000);
}
System.out.println( i );
}catch(Exception e){
}
}
}想用不同的线程extends thread 开多线程好了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货