This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
serialVersionUID is used for Serializable classes. I don't know about MyEclipse, but in the standard Eclipse, clicking on the icon which shows the warning will display a popup menu, with "Create serialVersionUID". Selecting this will add a serialVersionUID for you.
if you don't care about serialization, you can still add the default ID in your class : [code] private static final long serialVersionUID = 1L; [code] [ February 21, 2007: Message edited by: Satou kurinosuke ]
Joined: Jul 27, 2006
Yes... Even in MyEclipse by clicking on the icon which shows the warning displayed a popup menu, with "Create serialVersionUID". Selecting this added a serialVersionUID for me...
Now the Warning has gone...
But Can you help me in understanding What is the Use of this "serialVersionUID"....
Joined: Jan 02, 2007
You can turn that eclipse warning off in Window-Preferences->Java->Compiler->Errors/Warnings->Potential programming problems.
About Serial UID: serialVersionUID is used to ensure that someone using a newer version of your class can't deserialize an older instance or vice versa. Typically, if you change something minor in your class, like the implementation of a method, a old, saved instance of your class could be used with the new version without any problems. If you change the names of the class' fields or alter the purpose of the class, though, instances of that class that were saved under a previous version probably won't play well with the new class version. If you change something minor in your class, you can leave the serialVersionUID alone, but if you change something major, it's a good idea to change the serial version so that you or others don't get weird errors when using old instances with the new class.