Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do you identify independent and dependent variables?

1010


Do I need java for windows 10?

1050


What happens if constructor is private?

1039


What about interthread communication and how it takes place in java?

1067


Is hashset ordered?

1079


Difference between linkedlist and arraylist.

1081


What is parsing in grammar?

1044


What is the current version of java?

1045


What is the purpose of garbage collection in java?

1105


Can a class be private?

972


What is a short in java?

1055


what is daemon thread and which method is used to create the daemon thread? : Java thread

979


Is it possible to specify multiple jndi names when deploying an ejb?

1004


What do you mean by constant time complexity?

1257


I want to print “hello” even before main is executed. How will you acheive that?

1099