Core Java Archive

Java – Vector class

Vector : Vector class is the implementation of List interface. Vector class is available in java.util package. Vector class in java api Since jdk 1.0 Vector class is Ordered Vector class allows duplicates Vector class …

Java – LinkedList class

LinkedList: LinkedList maintains insertion order of elements as it is implementing Queue interface. If we create object for LinkedList and with LinkedList reference variable, we can access complete functionality of Queue, List and Deque. Note …

Java – PriorityQueue class

Queue interface : Queue based on the rule First In First Out(FIFO) LinkedList maintains insertion order of elements as it is implementing Queue interface. Queue implementations are LinkedList PriorityQueue PriorityQueue : Maintains insertion order but …

Java – LinkedHashSet

LinkedHashSet : The only difference between HashSet and LinkedHashSet is, HashSet does not maintain the insertion order of elements where as LinkedHashSet does it, using hashCode. LinkedHashSet since from jdk 1.4 Iterator : It is …

Java – Hashset class

Set interface: Implementations are HashSet LinkedHashSet TreeSet Note : HashSet & LinkedHashSet stores the data into collection Object according to HashTable algorithm. How the elements store into HashTable ? Every Hash table has a fixed …

Java – TreeSet class

TreeSet: TreeSet maintains sorted order of inserted elements. It will arrange the elements in ascending order using balanced binary search tree algorithm. since from jdk 1.2 HashSet doesn’t maintain insertion order. LinkedHashSet maintains insertion order …

Java – LinkedHashMap class

The only difference between LinkedHashMap and HashMap is, HashMap doesn’t maintain insertion order of elements where as LinkedHashMap does it. LinkedHashMap since jdk 1.4

Java – HashMap class

Map interface:  The implementations are HashMap LinkedHashMap TreeMap Note : HashMap and LinkedHashMap stores the elements according to Hashtable algorithm only. In Map interface, elements will be stored using keys. Keys are always unique(duplicates not …

Java – TreeMap class

TreeMap :• TreeMap maintains ascending order of keys.• TreeMap does it through Balanced binary trees. HashMap doesn’t maintain insertion order Linked HashMap maintains insertion order. TreeMap maintains Sorted order using keys. Reading and Storing Account …

Java – Codes on Collections

Reading and Storing Account objects into Map Collection: Store and Display student details into ArrayList collection object: Store and Display student details into ArrayList collection object:

Courses Enquiry Form