You are not logged in.

#1 2015-06-10 10:06:23

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Public Class Test:

Question:
public class Test
{

public static void main(String [] args)throws Exception
{

Object object = new Object();

synchronized (Thread.currentThread())
{
object.wait();
object.notify();
}

}

}

What is the result?

Option A):
Compiles successfully
Option B):
Throws an IlleagalStateException
Option C):
Throws an IllegalMonitorStateException
Option D):
Throws an InterruptedException

Correct Answer is Option C):
Throws an IllegalMonitorStateException


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-10 10:06:23

Advertisement
Ads By Google

Re: Public Class Test:



\n

Board footer