Java ObjectInputStream readField() MethodThe readField() method of ObjectInputStream class is used to read the persistent fields from the stream and makes them available by name. SyntaxParameterNo parameter is passed. Returnsthe GetField object representing the persistent fields of the object being deserialized ThrowsClassNotFoundException - if the class of a serialized object could not be found. IOException - if an I/O error occurs. NotActiveException - if the stream is not currently reading objects. Example 1Output: Welcome to javaTpoint Example 2Output: Using readFields() : Welcome to javaTpoint ---------------------------------------------------------- javaTpoint
Next TopicJava ObjectInputStream
|