Package java.io
Class NotSerializableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.io.ObjectStreamException
java.io.NotSerializableException
- All Implemented Interfaces:
Serializable
public class NotSerializableException extends ObjectStreamException
Signals that an object that is not serializable has been passed into the
ObjectOutput.writeObject() method. This can happen if the object
does not implement Serializable or Externalizable, or if it
is serializable but it overrides writeObject(ObjectOutputStream) and
explicitly prevents serialization by throwing this type of exception.-
Constructor Summary
Constructors Constructor Description NotSerializableException()Constructs a newNotSerializableExceptionwith its stack trace filled in.NotSerializableException(String detailMessage)Constructs a newNotSerializableExceptionwith its stack trace and detail message filled in. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NotSerializableException
public NotSerializableException()Constructs a newNotSerializableExceptionwith its stack trace filled in. -
NotSerializableException
Constructs a newNotSerializableExceptionwith its stack trace and detail message filled in.- Parameters:
detailMessage- the detail message for this exception.
-