1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Object Serialization
Java provides this mechanism, where an object can be represented as a sequence of bytes
Data, type, type of data
In Object Serialization what are included in making an object into a sequence of bytes
Deserialized
after a serualized objet has been written into a file, it can be read from the file and ________
ObjectInputStream
This class is a high-level stream that contain the methods for serializing an object
ObjectOutputStream
This class is a high-level stream that contain the methods for deserializing an object
writeObject
This method form the ObjectInputStream is responsible for writing the state of the object for its particular class so that the corresponding readObject method can restore it
Serializable
A class must implement this interface for it to be serialized
True
True or False
To successfully serailize a class, all of the fields in the class must be serializable
Transient
If a fields is not serializable it must be marked with this keywordq
FileOutputStream
The ObjectOutputStream wraps this class instance to write serialized objects to a file
FileInputStream
The ObjectInputStream wraps this class instance to write serialized objects to a file
True
True or False
Changing the serialVersionUID breaks deserializaton
False
True or False
Adding a new field to a serializable class will cause an error when deserializing old object
True
True or False
Removing a field from a class will always break deserialization
True
True or False
Chaning a field’s type can break deserialization
False
True or False
Reordoring fields in a class will break deserialization
False
True or False
Adding a static field affects deserialization.
True
True or False
Adding a transient filed is safe and does not break deserialization
True
True or False
Removing implements Serializable from a class makes old serialized object unreadable
False
True or False
Changing the access modifier of a field affects deserialization
False
True or False
Cgabgubg a constructor in a serializable class affects deserialization
True
True or False
A non-serializable parent class must have a no-arg constructor if its subclass is serializable
True
True or False
If a superclass becfome serializable after serializatoin, old object may not deserialize
False
True or False
Changing the body of a method in a serializable class can break deserialization.