Java Collections
ArrayList vs Vector
ArrayList and Vector both implements List interface and maintains insertion order. But there are many differences between ArrayList and Vector classes that are given below….
Properties class
The properties object contains key and value pair both as a string. It is the subclass of Hashtable. It can be used to get property…
Comparable vs Comparator
Comparable and Comparator both are interfaces and can be used to sort collection elements. But there are many differences between Comparable and Comparator interfaces that…
Comparator interface
Comparator interface is used to order the objects of user-defined class. This interface is found in java.util package and contains 2 methods compare(Object obj1,Object obj2)…
Comparable interface
Comparable interface is used to order the objects of user-defined class.This interface is found in java.lang package and contains only one method named compareTo(Object).It provide…
HashMap vs Hashtable
HashMap and Hashtable both are used to store data in key and value form. Both are using hashing technique to store unique keys. But there…
Hashtable class
A Hashtable is an array of list.Each list is known as a bucket.The position of bucket is identified by calling the hashcode() method.A Hashtable contains…
TreeMap class
A TreeMap contains values based on the key. It implements the NavigableMap interface and extends AbstractMap class. It contains only unique elements. It cannot have…
LinkedHashMap class
A LinkedHashMap contains values based on the key. It implements the Map interface and extends HashMap class. It contains only unique elements. It may have…