Java ObjectInputStream defaultReadObject() MethodThe defaultReadObject() method of ObjectInputStream class is used to read the non-static and non-transient fields of the current class from this stream, i.e, one cannot use defaultReadObject() to read the static fields. This may only be called from the readObject method of the class being desterilized. You cannot use defaultReadObject() directly. SyntaxParameterNo parameter is passed. ReturnsThe return type is void. ThrowsNotActiveException , ClassNotFoundException , IOException. Example 1Output: string that is in task class : javaTpoint Example 2Output: java.io.ObjectInputStream@1b28cdfa string that is in task class : javaTpoint
Next TopicJava ObjectInputStream
|