package test;
public class test {
public void f1() {
new Thread() {
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("f1");
}
}.start();
}
public void f2() {
new Thread() {
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("f2");
}
}.start();
}
public void f3() {
new Thread() {
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("f3");
}
}.start();
}
synchronized void m1() {
f1();
}
synchronized void m2() {
f2();
}
synchronized void m3() {
f3();
}
public static void main(String[] args) {
test test = new test();
test.m1();
test.m2();
test.m3();
}
}