I am reading the chapter on Serialization in Effective Java.
Who calls the readObject() and writeObject()? Why are these methods declared private ?
Regarding the transient variable, best way to understand as if why do we declare transient variable and later on serialize them in writeobject method is to check/analyze/debug readobject/writeobject methods of LinkedList/HashMap/etc classes.
This is generally done when you want to serialize/de-serialize the class variables in a pre-defined order and not rely on the default behavior/order.