Java Serialization

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

24 Terms

1
New cards

Object Serialization

Java provides this mechanism, where an object can be represented as a sequence of bytes

2
New cards

Data, type, type of data

In Object Serialization what are included in making an object into a sequence of bytes

3
New cards

Deserialized

after a serualized objet has been written into a file, it can be read from the file and ________

4
New cards

ObjectInputStream

This class is a high-level stream that contain the methods for serializing an object

5
New cards

ObjectOutputStream

This class is a high-level stream that contain the methods for deserializing an object

6
New cards

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

7
New cards

Serializable

A class must implement this interface for it to be serialized

8
New cards

True

True or False

To successfully serailize a class, all of the fields in the class must be serializable

9
New cards

Transient

If a fields is not serializable it must be marked with this keywordq

10
New cards

FileOutputStream

The ObjectOutputStream wraps this class instance to write serialized objects to a file

11
New cards

FileInputStream

The ObjectInputStream wraps this class instance to write serialized objects to a file

12
New cards

True

True or False

Changing the serialVersionUID breaks deserializaton

13
New cards

False

True or False

Adding a new field to a serializable class will cause an error when deserializing old object

14
New cards

True

True or False

Removing a field from a class will always break deserialization

15
New cards

True

True or False

Chaning a field’s type can break deserialization

16
New cards

False

True or False

Reordoring fields in a class will break deserialization

17
New cards

False

True or False

Adding a static field affects deserialization.

18
New cards

True

True or False

Adding a transient filed is safe and does not break deserialization

19
New cards

True

True or False

Removing implements Serializable from a class makes old serialized object unreadable

20
New cards

False

True or False

Changing the access modifier of a field affects deserialization

21
New cards

False

True or False

Cgabgubg a constructor in a serializable class affects deserialization

22
New cards

True

True or False

A non-serializable parent class must have a no-arg constructor if its subclass is serializable

23
New cards

True

True or False

If a superclass becfome serializable after serializatoin, old object may not deserialize

24
New cards

False

True or False

Changing the body of a method in a serializable class can break deserialization.