There are two "groups" of interfaces:
Collection
's and Map
's.
Here is a graphical overview of the
Collection
interface hierarchy:Collection Subtypes
The following interfaces (collection types) extends the Collection interface:
- List
- Set
- SortedSet
- NavigableSet
- Queue
- Deque
Instance Creations:
1.List
List listA = new ArrayList(); List listB = new LinkedList(); List listC = new Vector(); List listD = new Stack();2.Set
Set setA = new EnumSet(); Set setB = new HashSet(); Set setC = new LinkedHashSet(); Set setD = new TreeSet();3.SortedSet
SortedSet setA = new TreeSet(); Comparator comparator = new MyComparator(); SortedSet setB = new TreeSet(comparator);4.NavigableSet
NavigableSet original = new TreeSet();
1 comment:
Collection Subtypes:
1.List
2.Set
3.SortedSet
4.NavigableSet
5.Queue
6.Deque
Declaring Objects
1. List : List list = new ArrayList();
2.Set : Set set = new HashSet();
3.SortedSet : SortedSet set = new TreeSet();
4.NavigableSet : NavigableSet nSet = new ConcurrentSkipListSet();
Post a Comment