What are the differences between old array based implementation and Collection Framework based implementation of any data structure in Java?
Array based implementation :
Collection Framework provides following 9 important interfaces:
Array based implementation :
- Fixed in size
- Can hold only homogeneous data but not heterogeneous data
- Ready-made methods support is not available for any operation
- Performance is high, and recommended to use to obtain better performance
- Needs continuous memory and memory utilization is not good
- Can hold both objects and primitive
- dynamic size, we can grow or reduce size
- Ready-made methods support is available for various operations
- Performance is not good.
- Memory utilization point of view Collection is highly recommended
- Can hold only objects but not primitives
Collection Framework provides following 9 important interfaces:
- Collection : It is high level representation of a group of individual objects as a single entity. It is root interface of Collection framework and declares the most common methods which can be applicable for any Collection object.
- List : It is high level representation of a group of individual objects as a single entity where insertion order is preserved and duplicates are allowed.
No comments:
Post a Comment