/* test synchronized methods */ public class mainer { public static void main(String[]args) { foo f = new foo(); f.try1(); f.try2(); f.try3(); System.out.println("done."); } } class foo { public foo() { } public inline synchronized void try1() { System.out.println("1"); } public inline void try2() { synchronized (this) { System.out.println("2"); } } public static inline synchronized void try3() { System.out.println("3"); } }