Check out example codes for "serializable in JAVA". It will help you in understanding the concepts better.

Code Example 1

public class Employee implements java.io.Serializable {
   public String name;
   public String address;
   public transient int SSN;
   public int number;
   
   public void mailCheck() {
      System.out.println("Mailing a check to " + name + " " + address);
   }
}

Code Example 2

import java.io.Serializable;

Code Example 3

serialize(empObj);

Learn ReactJs, React Native from akashmittal.com