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


Please Help Members By Posting Answers For Below Questions

What are the differences between checked exception and unchecked exception?

524


What is difference between hashset and hashmap in java?

460


What is string variable?

562


How do you check if a string is lexicographically in java?

496


What is stringreader?

523






What is regex in java?

525


What is variable and example?

515


How do you sing an Applet ?

2028


What is data and its types?

571


How will you get the platform dependent values like line separator, path separator, etc., ?

579


Is list thread safe in java?

487


What is jit and its use?

576


What is boolean used for?

585


Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.

2278


Explain the advantages of packages in java?

513