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 meant by object oriented programming – oop?
What is the difference between the paint() and repaint() methods?
Which is easier .net or java?
Can I import same package/class twice?
does java support pointers?
Why scanner is used in java?
What is equals method in java?
What is byte data type?
What are the two types of java?
What is overriding in java?
Write a program to print count of empty strings in java 8?
Can a boolean be null java?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
What is class and object in java?
What is structure of java heap? What is perm gen space in heap?