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 data type is string java?
What modifiers are allowed for methods in an interface?
How do you change an int to a string?
Can we create object of inner class in java?
What is the difference between the direct buffer and non-direct buffer in java?
Is void a data type in java?
What is class array in java?
What is a variable analysis?
Can we sort a map in java?
How we can run a jar file through command prompt in java?
What is array list in java?
how to one war file class to another war file class?
What is singleton class example?
What is mnemonic in assembly language?
What is the major difference between linkedlist and arraylist?