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
How do you identify independent and dependent variables?
Do I need java for windows 10?
What happens if constructor is private?
What about interthread communication and how it takes place in java?
Is hashset ordered?
Difference between linkedlist and arraylist.
What is parsing in grammar?
What is the current version of java?
What is the purpose of garbage collection in java?
Can a class be private?
What is a short in java?
what is daemon thread and which method is used to create the daemon thread? : Java thread
Is it possible to specify multiple jndi names when deploying an ejb?
What do you mean by constant time complexity?
I want to print “hello” even before main is executed. How will you acheive that?