Why do we need a static lock for synchronizing system.out.println()? <p>I am studying for java certification, and I see this example from Mughal's book:</p> <pre><code>public class Smiley extends Thread { @Override public void run() { while(true) { synchronized(this) { try { System.out.print(":"); Thread.sleep(100); System.out.print("-"); Thread.sleep(100); System.out.println(")"); Thread.sleep(100); } catch(InterruptedException e) { e.printStackTrace(); } } } } public static void main(String[] args) { new Smiley().start(); new Smiley().start(); } } </code></pre> <p>The purpose is to print one smiley :-) per line. My question is that why synchronizing on instance (this) doesn't achieve this? Why we need to synchronize on static level?</p> <p>Thanks,</p>