You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> > Enumconstantsareserializeddifferentlythanordinaryserializableorexternalizableobjects. Theserializedformofanenumconstantconsistssolelyofitsname; fieldvaluesoftheconstantarenotpresentintheform. Toserializeanenumconstant, ObjectOutputStreamwritesthevaluereturnedbytheenumconstant's name method. To deserialize an enum constant, ObjectInputStream reads the constant name from the stream; the deserialized constant is then obtained by calling the java.lang.Enum.valueOf method, passing the constant'senumtypealongwiththereceivedconstantnameasarguments. Likeotherserializableorexternalizableobjects, enumconstantscanfunctionasthetargetsofbackreferencesappearingsubsequentlyintheserializationstream. Theprocessbywhichenumconstantsareserializedcannotbecustomized: anyclass-specificwriteObject, readObject, readObjectNoData, writeReplace, andreadResolvemethodsdefinedbyenumtypesareignoredduringserializationanddeserialization. Similarly, anyserialPersistentFieldsorserialVersionUIDfielddeclarationsarealsoignored--allenumtypeshaveafixedserialVersionUIDof0L. Documentingserializablefieldsanddataforenumtypesisunnecessary, sincethereisnovariationinthetypeofdatasent.