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 variable argument in java?

777


What is the maximum size of a string in java?

774


What is the difference between preparedstatement and statement in java?

831


What an i/o filter?

748


What is the difference between java applets and applications?

865


What is the difference between double and float variables in java?

877


Why does java does not support multiple inheritance? Explain

764


Explain inner classes ?

899


What is the effect of keeping a constructor private?

697


What is meant by collection in java?

804


What do you mean by composition in java?

792


What is the difference between serializable and externalizable interface?

807


What do you mean by ternary operator in java?

802


What is the inheritance?

757


Explain the advantages of packages in java?

724