Java - ObjectStreamClass

ObjectStreamClass act as a Serialization descriptor for class. This class contains the name and serialVersionUID of the class.

Fields

Modifier and TypeFieldDescription
static ObjectStreamField[]NO_FIELDSserialPersistentFields value indicating no serializable fields

Methods

Modifier and TypeMethodDescription
Class<?>forClass()It returns the class in the local VM that this version is mapped to.
ObjectStreamFieldgetField(String name)It gets the field of this class by name.
ObjectStreamField[]getFields()It returns an array of the fields of this serialization class.
StringgetName()It returns the name of the class described by this descriptor.
longgetSerialVersionUID()It returns the serialVersionUID for this class.
Static ObjectStreamClasslookup(Class<?> cl)It finds the descriptor for a class that can be serialized.
Static ObjectStreamClasslookupAny(Class<?> cl)It returns the descriptor for any class, regardless of whether it implements Serializable.
StringtoString()It returns a string describing this ObjectStreamClass.

Example

Output:

I price
null





Latest Courses