?? example19_1.java
字號:
public class Example19_1
{ static Lefthand left;
static Righthand right;
public static void main(String args[ ])
{ left=new Lefthand( );
right=new Righthand( ); //創建兩個線程
left.start( );
right.start( );
}
}
class Lefthand extends Thread
{ public void run( )
{ for(int i=0;i<=5;i++)
{ System.out.println("i am Lefthand");
try{sleep(500);}
catch(InterruptedException e) { }
}
}
}
class Righthand extends Thread
{ public void run( )
{ for(int i=0;i<=5;i++)
{ System.out.println("i am Righthand");
try{sleep(300);}
catch(InterruptedException e) { }
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -