Java Util

Java WeakHashMap Class

Introduction The WeakHashMap class in Java, part of the java.util package, is a hash table-based implementation of the Map interface with weak keys. Entries in a WeakHashMap are automatically removed when their keys are no longer in ordinary use, which allows for better memory management and helps avoid memory leaks in certain scenarios.

Java UUID Class

Introduction The UUID class in Java, part of the java.util package, is used to generate and manipulate Universally Unique Identifiers (UUIDs). A UUID is a 128-bit value used for uniquely identifying information in distributed systems without significant central coordination. The UUID class provides methods to create, convert, and work with UUIDs.

Java SortedSet Interface

Introduction The SortedSet interface in Java, part of the java.util package, represents a set that maintains its elements in ascending order. This interface extends the Set interface and provides methods for navigation and retrieving subsets. The most commonly used implementation of SortedSet is TreeSet.

Java SortedMap Interface

Introduction The SortedMap interface in Java, part of the java.util package, is a specialized map that maintains its entries in ascending key order. This interface extends the Map interface and adds methods that provide navigation and sorted views of the map. The most commonly used implementation of SortedMap is TreeMap.

Java Set Interface

Introduction The Set interface in Java, part of the java.util package, is a collection that does not allow duplicate elements. It models the mathematical set abstraction, providing operations to add, remove, and query elements. Common implementations include HashSet, LinkedHashSet, and TreeSet.

Java SequencedSet Interface

Introduction The SequencedSet interface in Java, introduced in Java 21, is part of the java.util package. It extends the Set interface and provides methods to access elements in a sequence, focusing on maintaining and accessing elements in a specific order, such as insertion order.

Java SequencedMap Interface

Introduction The SequencedMap interface in Java, introduced in Java 21, is part of the java.util package. It extends the Map interface and provides methods to access elements in a sequence, focusing on maintaining and accessing elements in a specific order, such as insertion order.

Java SequencedCollection Interface

Introduction The SequencedCollection interface in Java, introduced in Java 21, is part of the java.util package. It extends the Collection interface and provides methods to access elements in a sequence, specifically focusing on maintaining and accessing elements in a specific order, such as insertion order.

Java Scanner Class

Introduction The Scanner class in Java, part of the java.util package, is a utility class used to parse primitive types and strings using regular expressions.  It can read input from various sources, including strings, files, and input streams.  The Scanner class is widely used for reading user input in console applications.

Java Queue Interface

Introduction The Queue interface in Java, part of the java.util package, represents a collection designed for holding elements prior to processing. It follows a first-in, first-out (FIFO) principle, though other types of ordering are possible depending on the implementation. Common implementations include LinkedList, PriorityQueue, and ArrayDeque.

Java Properties Class

Introduction The Properties class in Java, part of the java.util package, is a subclass of Hashtable that is used to maintain lists of values in which the key and the value are both String. It is typically used to manage application configuration settings, where key-value pairs represent configuration properties.

Java OptionalLong Class

Introduction The OptionalLong class in Java, part of the java.util package, is a container object which may or may not contain a primitive long value. It is designed to handle optional primitive long values gracefully, avoiding NullPointerException and providing a more functional approach to dealing with optional values.

Java OptionalInt Class

Introduction The OptionalInt class in Java, part of the java.util package, is a container object which may or may not contain a primitive int value. It is designed to handle optional primitive int values gracefully, avoiding NullPointerException and providing a more functional approach to dealing with optional values.

Java OptionalDouble Class

Introduction The OptionalDouble class in Java, part of the java.util package, is a container object which may or may not contain a double value. It is designed to handle optional primitive double values gracefully, avoiding NullPointerException and providing a more functional approach to dealing with optional values.

Scroll to Top