What is the need to implement Serializable interface (with
no methods) for objects which are to be serialized ?
We can write our own functionality which writes objects to
streams then why we need to implement and tell JVM that
which objects can be serialized.

Answer Posted / chellammal

Implementing Serializable interface signifies that the
object can be persisted. Otherwise, when you try to
use writeObject, it will throw
java.io.NotSerializableException

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of singleton class?

518


What are advantages and disadvantages of OOPs?

625


What is finally block?

564


Define immutable object?

577


Can a constructor be protected?

529






What is the range of a character variable?

541


Why 1 is not a prime number?

550


What are computer functions?

478


What is string length in java?

488


Explain about procedural programming language or structured programming language and its features?

544


Can private members of a base class are inheritable justify?

483


why Interface used?

535


What is equals method in java?

522


What is the parse method in java?

561


What is OOP Language?

624