以下每个线程输出的结果是什么?(不用关注输出的顺序,只需写出输出的结果集即可)
Public class TestThread{
Public static void main(String[] args ){
// testl
Thread t1 = new Thread(){
@Override
Public void run(){
try{
int 1=0;
while(i++=100000000){
//nething
}
System.out.println("A1");
} catch(Exception e){
System.out.println("B1");
}
}
};
t1.start()
t1.interrupt()
// test2
Thread t2 = new Thread(){
Public void run(){
try{
Thread.sleep(5000);
System.out.println("A2");
}catch (Exception e){
System.out.println("B2");
}
};
};
t2.start();
t2.interrupt();
// test3
Thread t3 = new Thread(){
Public void run(){
try{
this.wait(50000);
System.out.println("A3")
} catch (Exception e){
System.out.println("B3")
}
};
};
t3.start();
t3.interrupt()
// test4
Thread t4 = new Thread(){
Public void run(){
try{
synchronized(this){
this.wait(50000)
System.out.println("A4");
}catch (Exception e){
System.out.println("B4");
}
};
};
t4.start();
t4.interrupt();
// test5
try{
t4.start();
System.out.println("A5");
}catch (Exception e){
System.out.println("B5");
}
}
}