Begginer in java
<p>Given the following</p>

<pre><code>public class WaitTest {

    public static void main(String[] args) {
        System.out.print("1 ");
        synchronized (args) {
            System.out.print("2 ");
            try {
                args.wait();
            } catch (InterruptedException e) {
            }
        }
        System.out.print("3 ");
    }
}
</code></pre>

<p>What is the result of trying to compile and run this program?</p>

<ol>
<li>It fails to compile because the IllegalMonitorStateException of wait() is not dealt with inline 7.</li>
<li>1 2 3                </li>
<li>1 3</li>
<li>1 2</li>
<li>At runtime, it throws an IllegalMonitorStateException when trying to wait.</li>
<li>It will fail to compile because it has to be synchronized on the this object.</li>
</ol>

<p>According me the answer should be 1,2,3 line no. 11 should get printed but the answer for this question is D why </p>
