What is serialVersionUID and what is its need?
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 |
What is the difference between static synchronize() metod and synchronize() method?
what is request dispatcher and how does it work?
Explain about anonymous inner classes in java?
what is deadlock in threads? with example
What are the different types of garbage collectors in java?
what is ejb? what is the importance of ejb?
What classes of exceptions, caught by a catch clause?
Can we return null in java?
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
Explain java thread life cycle.
What is computer compiler?
WHAT IS MARKER INTERFACE,AND NO METHODS IS NOT THERE ON THAT INTERFACE THEN WHY WE USED IN JAVA?