Class NotActiveException in Java

digitization, transformation, binary

Class NotActiveException in Java

An application can throw NotActiveException if it invokes a method either the method never invoked at the right time or the method is invoked in a wrong context.
A NotActiveException is also thrown to indicate that an inappropriate method is being called when serialization or deserialization is not in progress.
If an ObjectInputStream or ObjectOutputStream is not currently active, the operations on one of these could not be performed.
NotActiveException is a subclass of ObjectStreamException and is common exception classes in java.

The structure of NotActiveException class is given as:

public class java.io.NotActiveException extends java.io.ObjectStreamException{
//constructors:
public NotActiveException();//default constructor
public NotActiveException(String message);
} 

The details of the methods are described as:

Ads code goes here
public NotActiveException();//default constructor

public NotActiveException() is a default constructor.This constructor creates a NotActiveException with no detail message

public NotActiveException(String message);

public NotActiveException(String message) is another constructor that creates a NotActiveException with the specified detail message.
Parameter
message-The detail message.
The class NotActiveException also inherits methods from class Object and Throwable.

From Object classFrom Throwable class
clone()fillInStackTrace()
getClass()getMessage()
notify()printStackTrace()
wait()printStackTrace(PrintWriter)
wait(long, int)getLocalizedMessage()
wait(long)printStackTrace(PrintStream)
equals(Object)
toString()
finalize()
hashCode()
notifyAll()

Share and Enjoy !

READ  Class StreamTokenizer in Java

Leave a Comment

Your email address will not be published. Required fields are marked *