public class JavaSynchronizedMethod { public synchronized void doSomething() { System.out.println("doSomething"); } }