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 / aman kr aggarwal
well if we dont use Serializable interface which is a
marker interface, then the object which we want to
serialize and use writeObject() method then compiler would
throw exception as if other object which r related to that
object if not serialized.
So. to overcome this we have to use Seializable interface.
Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
What are passing parameters?
How does hashset work in java?
What are conditionals and its types?
What is method overloading in JAVA? Why is it not present in C ?
What is the intersection and union methods?
What is operator overloading. Is it is supported in java?
What is the difference between variable declaration and variable initialization?
What are the approaches that you will follow for making a program very efficient?
What is difference between adapter class and listener?
What is intern method in java?
How do you call a reference in java?
How does remove work in java?
What does function identity () do?
When is the finally clause of a try-catch-finally statement executed?
Explain garbage collection in java?