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 called module?
What are the methods used to implement for the key object in the hash map?
What is the difference between the direct buffer and non-direct buffer in java?
What are the new features in java 8? Explain
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Can we use string in switch case in java?
What is constructor and virtual function? Can we call a virtual function in a constructor?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
What is :: operator in java?
How to find the given number is a prime number or not by getting input from the user
Is string an object?
What is object-oriented programming?
What is string args [] in java?
Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me
How does arraylist work in java?