how a marker interface gets its functionality and when we
implements a marker interface how it got invoked
Answer Posted / yadav
Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable.
Classes that require special handling during the serialization and deserialization process must implement special methods with these exact signatures:
private void writeObject(java.io.ObjectOutputStream out)
throws IOException
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is api in java?
How many types of voids are there?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
Is string an object?
How many decimal places is a double?
Does java allow default arguments?
How many characters is 16 bytes?
Why do people says “java is robust”?
Explain about instanceof operator in java?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Name few java 8 annotations ?
What is the original name of java?
What will happen if a thrown exception is not handled?
what is session in java?
Can we override the overloaded method?