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

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...