Skip to content

Instantly share code, notes, and snippets.

@takuma7
Created December 16, 2011 02:26
Show Gist options
  • Save takuma7/1484143 to your computer and use it in GitHub Desktop.
Save takuma7/1484143 to your computer and use it in GitHub Desktop.
public class Mondai16_3{
public static void main(String[] args){
MyThreadA a = new MyThreadA();
MyThreadB b = new MyThreadB();
a.start();
b.start();
}
}
class MyThreadA extends Thread{
public void run(){
for(int i=0; i<10; i++){
try{
Thread.sleep(3000);
}catch(InterruptedException e){}
System.out.println("***");
}
}
}
class MyThreadB extends Thread{
public void run(){
for(int i=0; i<10; i++){
try{
Thread.sleep(5000);
}catch(InterruptedException e){}
System.out.println("====");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment