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 is a top level class in java?
How do you define a variable?
Explain the different forms of polymorphism?
What does string intern() method do?
What is google full form?
How can we use primitive data types as objects?
Is nullpointerexception checked or unchecked?
Which is faster string or stringbuilder?
Which is illegal identifier in java?
What is the difference between static and non-static variables in java programming?
What is merge sort in java?
What are the different types of sorting in java?
What is udp in java?
What is gui programming?
What are the basic concepts of OOPS in java?