We are using Collection below listed reason....
1. For using interface to represent and access a collection e.g.
use List to store ArrayList
useMap to store HashMap.
2. For using the collection if we need a non-synchronised list, then we go for ArrayList and not Vector.
3. For synchronized collection we are using concurrent collection over it.
4. In case of any loop like for ,forEach we are using iterator in collection.
1. For using interface to represent and access a collection e.g.
use List to store ArrayList
useMap to store HashMap.
2. For using the collection if we need a non-synchronised list, then we go for ArrayList and not Vector.
3. For synchronized collection we are using concurrent collection over it.
4. In case of any loop like for ,forEach we are using iterator in collection.
No comments:
Post a Comment