Arpan Ghoshal wrote:Here the Cat class contains an instance variable containing an object of class Tail but the Tail class is not marked Serializable then how does this code work ?
Also does a class need to marked serializable to be written to a file using writeObject() ? I think the answer is no then I can't understand what is actually the need for Serialization ?
Why doesn't it print D also ?
Why shouldn't every class be marked Serializable ?
One of the answers said : The compiler will throw an exception if certain classes are marked Serializable
Arpan Ghoshal wrote:Can someone explain this sentence possibly with an example because it seems too difficult to understand for me.
Junilu Lacar wrote:Those algorithms usually require you to keep track of which nodes have already been visited.