Why Collection doesn’t extend Cloneable and Serializable interfaces?

Technology CommunityCategory: JavaWhy Collection doesn’t extend Cloneable and Serializable interfaces?
VietMX Staff asked 4 years ago

The Collection interface specifies groups of objects known as elements. Each concrete implementation of a Collection can choose its own way of how to maintain and order its elements. Some collections allow duplicate keys, while some other collections don’t. The semantics and the implications of either cloning or serialization come into play when dealing with actual implementations. Thus, the concrete implementations of collections should decide how they can be cloned or serialized.