Java ObjectInputStream readUnshared() MethodThe readUnshared() method of ObjectInputStream class reads an "unshared" object from the ObjectInputStream. This method is identical to the readObject method, except that it prevents subsequent calls to readObject and readUnshared from returning additional references to the deserialized instance obtained via this call. SyntaxParameterNo parameter is passed. ReturnsReference to the deserialized object ThrowsClassNotFoundException StreamCorruptedException ObjectStreamException OptionalDataException IOException Example 1Output: Welcome to javaTpoint Example 2Output: java.io.ObjectInputStream@1b28cdfa string that is in task class : javaTpoint
Next TopicJava ObjectInputStream
|