kushi
kushi

Reputation: 389

Java Serialization - wrapper class

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

Answers (3)

Aniket Thakur
Aniket Thakur

Reputation: 68935

Because these classes are meant to be stored in some persistent storage or transferred via network as stream of bytes.

Upvotes: 2

Philipp Sander
Philipp Sander

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

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62864

Because there are cases which require the instances of these classes to be

Upvotes: 3

Related Questions