Hey, I was learning Swing via Swing Tutorial Part II earlier http://www.dreaminco...torial-part-ii/, and when I typed line 13 from the first code into eclipse, it said that it didn't contain a static final serialVersionUID field of type long. Why do I need to put this code in and what should I put in for the actual serial number???
Java Serializable Class Help?
Page 1 of 13 Replies - 529 Views - Last Post: 05 March 2011 - 09:49 AM
Replies To: Java Serializable Class Help?
#2
Re: Java Serializable Class Help?
Posted 04 March 2011 - 11:13 AM
It is a number that identifies the "version" of the class. When the server serves an instance of this class to the client, the client checks that it's version matches the version of that from the server to ensure compatability. You do not have to provide one. If you don't the server will generate one, based on the class definition, and the client will also generate one, based on its class definition, and will compare those.
#3
Re: Java Serializable Class Help?
Posted 04 March 2011 - 06:40 PM
I usually put, as an long: YYMMDDHHMML
It garanties uniqness within my classes and also makes a timestamp of when I wrote the class for the first time
As I do not more than a class per minute the numbers stay unique
It garanties uniqness within my classes and also makes a timestamp of when I wrote the class for the first time
As I do not more than a class per minute the numbers stay unique
#4
Re: Java Serializable Class Help?
Posted 05 March 2011 - 09:49 AM
Ight, Thanks guys
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|