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 the fileinputstream and fileoutputstream?
How is string immutable in java?
What is the core java?
Explain creating threads by extending thread class ?
How can we make a class singleton?
What is integer parseint?
What is public/private protected in java?
What is the effect of keeping a constructor private?
Using callable statement how can you pass out parameters, explain with example?
Can java program run without jre?
What is singleton class in java and how can we make a class singleton?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Have you ever used hashtable and dictionary?
Explain how hashmap works?
What is the purpose of stub and skeleton?