From the Java Language Specification:
Variables may be marked transient to indicate that they are not part of the persistent state of an object.
For instance, fields in the class that can be derived from other fields in the class. Good example would be to save Image objects as transient object. When object is being de-serialized transient fields usually need to be reinitialized.
Eg:
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException{inputStream.defaultReadObject();generateImage();}
In this example generateImage method needs to be called to read the image based on some non-transient variables (such as path to the image) 🙂