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
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 …
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 …
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 …
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 …
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 …
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 …
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 …
Generics Introduction: Generics are parameterized types, where class, interface methods are parameterized with types. Same like the more parameters used in method declarations, type parameters provide a way for you to re-use the same code with …
ArrayList : ArrayList is the implementation of List interface. ArrayList is available in java.util package. ArrayList class in java api since jdk 1.2 ArrayList is an ordered collection and allows duplicates. The Initial capacity of …