What is serialVersionUID and what is its need?
Answer Posted / javamasque
The serial version UID is metadata about the serializable object, it is hash code for the serializable object. It contains information about class name, field name, field type, implemented interfaces and super classes. For each modification to serializable object, we have to update serial version UID explicitly. If we do not provide any serial version UID, JVM’s default serialization mechanism generates serial version UID for the object at runtime.
During deserialization, JVM matches the serial version UID from object stream with the serializable object which will receive the stream data. If there is a mismatch in serial version UID, JVM throws InvalidClassException
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What does sizeof return?
What is the full form of jpeg?
Is 0 true or false in java?
What is java basic concept?
What is the meaning of variables in research?
What does this () mean in constructor chaining concept?
Explain the importance of throws keyword in java?
Differences between external iteration and internal iteration?
What is public/private protected in java?
Can you give names of Container classes?
How many types of gc are there in java?
Can a class be declared as protected?
What is a lock or purpose of locks in java?
What are the main uses of this keyword?
Explain about varargs in java?