Reputation: 389
I keep reading about serialization.. I understand how to serialize and deserialize custom objects. But I am not able to understand the rational behind why many classes in JAVA API implement Serialize by default.
Upvotes: 0
Views: 3475
Reputation: 68935
Because these classes are meant to be stored in some persistent storage or transferred via network as stream of bytes.
Upvotes: 2
Reputation: 10249
Because you can only serialize objects that are serializable. So if you have a field of a non serializable type, this field will not be serialized
Upvotes: 3
Reputation: 62864
Because there are cases which require the instances of these classes to be
Upvotes: 3