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 return used for in java?

530


What are the legal operands of the instanceof operator?

574


How do you reverse sort a list in java?

521


What is difference between checked and unchecked exception in java?

587


What is the static method?

577






Which software is used for java programming?

565


What is an abstract method in java programming?

609


What is type parameter in java?

531


Can an interface be defined inside a class?

526


What is hash code collision?

599


Why are pointers not secure?

545


What is the purpose of a volatile variable?

561


Which java ide is used the most?

516


Is a boolean 1 bit?

620


How can you add and remove nodes in jtree?

623