Serialization & Deserialization

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

1/15

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

What is serialization?

The process of converting an object into a format that can be stored or transmitted.

2
New cards

What is deserialization?

The process of reconstructing an object from its serialized form.

3
New cards

Why is serialization needed?

To save an object's state or send it over a network.

4
New cards

Name common formats used for serialization.

JSON, XML, YAML, Protocol Buffers, Avro.

5
New cards

What is Java’s built-in mechanism for serialization?

Implementing the Serializable interface.

6
New cards

What method is used to serialize an object in Java?

ObjectOutputStream.writeObject()

7
New cards

What method is used to deserialize an object in Java?

ObjectInputStream.readObject()

8
New cards

What is a serialVersionUID in Java?

A unique identifier to verify compatibility during deserialization.

9
New cards

What is the risk of deserialization?

Security vulnerabilities, such as remote code execution if data is tampered with.

10
New cards

What is custom serialization?

Overriding default serialization by implementing writeObject and readObject methods.

11
New cards

How can performance be improved in serialization?

By using more efficient formats like Protocol Buffers or Avro.

12
New cards

What is deep serialization?

Serializing an object along with the objects it references.

13
New cards

What is a common use case of serialization?

Storing session data or sending objects in distributed systems.

14
New cards

What happens if a non-serializable field is encountered?

Java throws a NotSerializableException.

15
New cards

What annotation can be used to ignore a field during serialization?

transient keyword in Java.

16
New cards