@@ -0,0 +1,285 @@
+package thread;%0A%0Apublic class SynchronizedTest %7B%0A    %0A    public static void main(String%5B%5D args) %7B%0A        new SynchronizedTest().foo();%0A    %7D%0A    %0A    private synchronized void foo() %7B%0A        bar();%0A    %7D%0A    %0A    private void bar() %7B%0A        System.out.println(%22OK!%22);%0A    %7D%0A    %0A%7D%0A

add SynchronizedTest.java