All About Class IllegalMonitorStateException in Java



IllegalMonitorStateException is thrown when a thread has tried to wait on an object's monitor or to notify other threads waiting on an object's monitor,without owning the specified monitor.
A  monitor is a piece of code to use for synchronizing threads by indicating the current state of the thread that owns it. This exception IllegalMonitorStateException  is thrown if that state becomes illegal.
The structure of this class as follows:


public class java.lang.IllegalMonitorStateExceptionextends java.lang.RuntimeException{
//constructor
public IllegalMonitorStateException();
//constructs an empty IllegalMonitorStateException object that is an object with no message specified.
public IllegalMonitorStateException(String message);
//constructs an IllegalMonitorStateException object with the message specified.

}
 
All About Class IllegalMonitorStateException in Java All About Class IllegalMonitorStateException in Java Reviewed by Animesh Chatterjee on September 17, 2018 Rating: 5

No comments:

Powered by Blogger.