Tuesday, 25 February 2014

COLLECTIONS IN JAVA

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();
 
http://www.jitendrazaa.com/blog/wp-content/uploads/2011/04/Java-Collection-interfaces-and-concrete-classes.jpg 
 
 
JAVA Map interface and concrete classes 
Print Friendly and PDF

1 comment:

Ravi said...

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();

Simplest way to display Server Time in JSP using js

THE BELOW CODE WORKS ONLY IN JSP : <html> <body > <table width="95%" border="1" cellpadding="1...