The method readResolve is used to replace the object read from the stream and should be declared with a return type of ______.

  • Object
  • Serializable
  • readObject
  • void
The readResolve method in Java is used to replace the object read from the stream with another object. It should be declared with a return type of Object to ensure that it can return the replacement object correctly. The other options are not appropriate return types for the readResolve method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *