---
type: archive
area: archive
status: archived
date: 2026-05-03
created: 2026-05-03
updated: 1980-01-01
tags:
  - archive
---
### <mark style="background: #FF5582A6;">Serialization :</mark>
- The process of converting an object into a byte stream. // Persists (saves the state) the object after program exits 
- This byte stream can be saved as a file or sent over a network // Byte stream can be saved as a file (.ser) which is platform independent // (Think of this as if you're saving a file with the object's information)
##### <mark style="background: #FFF3A3A6;">Steps to Serialize</mark>
1. Your class should implement Serializable interface 
2. add import java.io.Serializable;
3. FileOutputStream fileOut = new FileOutputStream(file path) 
4. ObjectOutputStream out = new ObjectOutputStream(fileOut);
5. out.writeObject(objectName) 
6. out.close(); 
7. fileOut.close(); 
### <mark style="background: #FF5582A6;">Deserialization :</mark>
The reverse process of converting a byte stream into an object. // (Think of this as if you're loading a saved file) 
##### <mark style="background: #FFF3A3A6;">Steps to Deserialize</mark>
1. Your class should implement Serializable interface 
2. add import java.io.Serializable; 
3. FileInputStream fileIn = new FileInputStream(file path); 
4. ObjectInputStream in = new ObjectInputStream(fileIn); 
5. objectNam = (Class) in.readObject(); 
6. in.close();
7. fileIn.close(); 

