The IdentityHashMap implements Map interface using Hashtable, using reference-equality in place of object-equality when comparing keys (and values). This class is not a general-purpose Map… Read More
Tag Archives: Java-Collections
Arrays.binarySearch()| Set 1 Covers how to find an element in a sorted array in Java. This set will cover “How to Search a key in… Read More
Implementation of ArrayList is not synchronized by default. It means if a thread modifies it structurally and multiple threads access it concurrently, it must be… Read More
EnumMap is a specialized implementation of the Map interface for enumeration types. It extends AbstractMap and implements the Map interface in Java. It belongs to… Read More
Following methods can be used for converting Array To ArrayList: Method 1: Using Arrays.asList() method Syntax: public static List asList(T... a) // Returns… Read More
java.util.Collections.singleton() method is a java.util.Collections class method. It creates a immutable set over a single specified element. An application of this method is to remove… Read More
ArrayList and Vectors both implement the List interface, and both use (dynamically resizable) arrays for their internal data structure, much like using an ordinary array. … Read More
Enumerations or popularly known as enum serve the purpose of representing a group of named constants in a programming language. For example, the 4 suits… Read More
Arrays.binarySearch() method searches the specified array of the given data type for the specified value using the binary search algorithm. The array must be sorted… Read More
HashMap Class Methods in Java with Examples | Set 1 (put(), get(), isEmpty() and size()) In this post more methods are discussed. keySet(): java.util.HashMap.keySet() It… Read More
HashMap is a data structure that uses a hash function to map identifying values, known as keys, to their associated values. It contains “key-value” pairs… Read More
List interface in Java (which is implemented by ArrayList and LinkedList) provides two versions of remove method. boolean remove(Object obj) : It accepts object to be removed.… Read More
TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements… Read More
Today we are going to discuss the simplest way to print the array as a string in Java: Arrays.toString() method. How to use Arrays.toString() method? … Read More
java.util.Arrays.copyOf() method is in java.util.Arrays class. It copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length.… Read More