Java ObjectInputStream readObject() MethodThe readObject() method of ObjectInputStream class is used to read an object from the objectinputstream. It reads the class of the object, the signature of the class, static, non-static fields and supertype. SyntaxParameterNA ReturnsThe object read from the stream. ThrowsClassNotFoundException InvalidClassException StreamCorruptedException OptionalDataException IOException Example 1Output: String in Serializable Class : Welcome to javaTpoint String in MainClass : JavaTpoint Example 2Output: java.io.ObjectInputStream@1b28cdfa string in Work class : javaTpoint
Next TopicJava ObjectInputStream
|