when to use serializable in java

Java
        serialize(empObj);
Source

Also in Java: