InvalidObjectException Class in Java

digitization, transformation, binary

InvalidObjectException Class in Java

This InvalidObjectException should be thrown by the validateObject() method of an object that implements the ObjectInputValidation interface when a deserialized object fails an input validation test for any reason.

In short, an InvalidObjectException is thrown by an object to indicate that it cannot validate itself during object
deserialization.

Ads code goes here
public class java.io.InvalidobjectException extends java.io.ObjectStreamException
// Public Constructor
public InvalidobjectException (String reason);
}

The details of the method are given as:

public InvalidobjectException (String reason);

public InvalidobjectException (String reason) constructor creates an InvalidObjectException with the specified detail message, which should be the name of the class.
parameters
reason-The detail message.
The class InvalidObjectException 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  PrintWriter Class in Java

Leave a Comment

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