Saturday 16 August 2014

Java Collections- Everything you want to know

Collection is an interface - is a framework which allows for using and manipulating collections.


Two interface trees, one starting with Collection and including Set, SortedSet, List, and Queue, and the other starting with Map and including SortedMap.

Set- A collection that cannot contain duplicate elements.
2. Elements are in unordered manner.

List- A collection that can contain duplicate elements.
Elements are in ordered manner.

Read more about List here


Map and HashMap
Map is a n interface and Hash Map is class that implements it.

Iterator:1. Used to iterate over collections.
2. Move only in forward direction.

List Iterator : Used to iterate over List Collection specifically.
2. can traverse in both forward and backward direction.

No comments:

Post a Comment