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
How do you differentiate abstract class from interface?
Define "Access specifiers" in java.
How can you avoid serialization in child class if the base class is implementing the serializable interface?
What is the difference between static and global variables and also define what are volatile variables?
Tell me are there implementations for sorting and searching in the java libarary?
What is final keyword?
What is a method signature java?
What is the difference between super class & sub class?
What is used of static keyword in java?
What is a container in a gui?
how can i use a nonsynchronized hashtable?
What is the difference between a method and a procedure?
Is java code slower than native code?
How to display arraylist values in java?
Why is java logo a cup of coffee?