What is fail-fast Property

At high level – Fail-fast is a property of a system or software with respect to its response to failures. A fail-fast system is designed to immediately report any failure or condition that is likely to lead to failure. Fail-fast systems are usually designed to stop normal operation rather than attempt to continue a possibly-flawed … Read more

What does Synchronized means in Hashtable Context

Synchronized means only one thread can modify a hash table at one point of time. Any thread before performing an update on a hashtable will have to acquire a lock on the object while others will wait for lock to be released In the context of Hashtable in Java, the synchronized keyword is used to … Read more

Difference Between HashMap and HashTable? Compare Hashtable vs HashMap

Both Hashtable & HashMap provide key-value access to data. The Hashtable is one of the original collection classes in Java (also called as legacy classes). HashMap is part of the new Collections Framework, added with Java 2, v1.2. There are several differences between HashMap and Hashtable in Java as listed below The HashMap class is … Read more

What is HashMap and Map

Map is Interface which is part of Java collections framework. This is to store Key Value pair, and Hashmap is class that implements that using hashing technique. In Core Java: Map: A Map is an interface in Java that represents a collection of key-value pairs, where each key is associated with exactly one value. It … Read more

What is the Difference Between Java.util.Iterator and java.util.ListIterator

Iterator : Enables you to traverse through a collection in the forward direction only, for obtaining or removing elements ListIterator : extends Iterator, and allows bidirectional traversal of list and also allows the modification of elements. In Java, java.util.Iterator and java.util.ListIterator are both interfaces that belong to the java.util package and are used for iterating … Read more