Have a Question?

If you have any question you can ask below or enter what you are looking for!

Tag: Collection interview question

What is a Collection class in Java?

What is a Collection class in Java?

What is a Collection class in Java? Collections class defines several utility methods for collection objects like sorting, searching, reversing, etc.  Sorting elements of List  Collections class defines the following two methods for sorting. 1 Public static void sort(List l) To sort based on default natural sorting order In this . . . Read more

What is IdentityHashMap?

What is IdentityHashMap?

What is IdentityHashMap? In journal == operator meant for reference comparison (address comparison) and equals() method meant for content comparison. It is exactly same as HashMap(including methods and constructors) except the following difference. In the case of normal HashMap, JVM will use .equals() method to identify duplicates keys, which is meant for content . . . Read more

Difference between HashMap & Hashtable in Java?

Difference between HashMap & Hashtable in Java?

Difference between HashMap & Hashtable in Java? The underlying data-structure is HashTable. Insertion order is not preserved and it is based on HashCode is keys. Duplicate keys are not allowed but values can be duplicated. Heterogeneous objects are allowed for both Key and value. Null is allowed for Key(only once). . . . Read more