It is necessary for serialization, although it is usually a private field. ALL classes in classpath which implement java.io.Serializable should declare this field, and it should match the results of running Sun's serialver tool on that class; otherwise, Classpath will not be compatible for serialization. java.io.ObjectStream uses the value of this field to see if two class versions are compatible. This field is needed in Classpath even when Sun's jar does not have the field. (Interfaces which extend Serializable do not need this field).
Giannis Georgalis wrote: > Hello again from the primary spammer of the GNU classpath list :) > > I have one question. Please forgive my ignorance, as I'm new to the > classpath project. > > What is serialVersionUID?, what is it used for? (instanceof operator?), > where can I find it's value for a specific class? and should *all* the > api classes have this constant? > > Thank you, > Giannis > -- This signature intentionally left boring. Eric Blake [EMAIL PROTECTED] BYU student, free software programmer _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath