java.util
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes. This package also contains legacy collection classes and legacy date and time classes."Java Collections Framework"
For an overview, API outline, and design rationale, please see:
For a tutorial and programming guide with examples of use of the collections framework, please see:
Interfaces
| Collection<E> | The root interface in the collection hierarchy. | 
| Comparator<T> | A comparison function, which imposes a total ordering on some collection of objects. | 
| Deque<E> | A linear collection that supports element insertion and removal at both ends. | 
| Enumeration<E> | An object that implements the Enumeration interface generates a series of elements, one at a time. | 
| EventListener | A tagging interface that all event listener interfaces must extend. | 
| Formattable | The Formattableinterface must be implemented by any class that
 needs to perform custom formatting using the's'conversion
 specifier ofFormatter. | 
| Iterator<E> | An iterator over a collection. | 
| List<E> | An ordered collection, where the user has precise control over where in the list each element is inserted. | 
| ListIterator<E> | An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list. | 
| Map<K, V> | An object that maps keys to values. | 
| Map.Entry<K, V> | A map entry (key-value pair). | 
| NavigableMap<K, V> | A SortedMapextended with navigation methods returning the
 closest matches for given search targets. | 
| NavigableSet<E> | A SortedSetextended with navigation methods reporting
 closest matches for given search targets. | 
| Observer | This interface was deprecated
      in API level 33.
    This interface has been deprecated. See the Observableclass for further information. | 
| PrimitiveIterator<T, T_CONS> | A base type for primitive specializations of Iterator. | 
| PrimitiveIterator.OfDouble | An Iterator specialized for doublevalues. | 
| PrimitiveIterator.OfInt | An Iterator specialized for intvalues. | 
| PrimitiveIterator.OfLong | An Iterator specialized for longvalues. | 
| Queue<E> | A collection designed for holding elements prior to processing. | 
| RandomAccess | Marker interface used by Listimplementations to indicate that
 they support fast (generally constant time) random access. | 
| SequencedCollection<E> | A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible. | 
| SequencedMap<K, V> | A Map that has a well-defined encounter order, that supports operations at both ends, and that is reversible. | 
| SequencedSet<E> | A collection that is both a SequencedCollectionand aSet. | 
| ServiceLoader.Provider<S> | Represents a service provider located by ServiceLoader. | 
| Set<E> | A collection that contains no duplicate elements. | 
| SortedMap<K, V> | A Mapthat further provides a total ordering on its keys. | 
| SortedSet<E> | A Setthat further provides a total ordering on its elements. | 
| Spliterator<T> | An object for traversing and partitioning elements of a source. | 
| Spliterator.OfDouble | A Spliterator specialized for doublevalues. | 
| Spliterator.OfInt | A Spliterator specialized for intvalues. | 
| Spliterator.OfLong | A Spliterator specialized for longvalues. | 
| Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends OfPrimitive<T, T_CONS, T_SPLITR>> | A Spliterator specialized for primitive values. | 
Classes
| AbstractCollection<E> | This class provides a skeletal implementation of the Collectioninterface, to minimize the effort required to implement this interface. | 
| AbstractList<E> | This class provides a skeletal implementation of the Listinterface to minimize the effort required to implement this interface
 backed by a "random access" data store (such as an array). | 
| AbstractMap<K, V> | This class provides a skeletal implementation of the Mapinterface, to minimize the effort required to implement this interface. | 
| AbstractMap.SimpleEntry<K, V> | An Entry maintaining a key and a value. | 
| AbstractMap.SimpleImmutableEntry<K, V> | An unmodifiable Entry maintaining a key and a value. | 
| AbstractQueue<E> | This class provides skeletal implementations of some Queueoperations. | 
| AbstractSequentialList<E> | This class provides a skeletal implementation of the Listinterface to minimize the effort required to implement this interface
 backed by a "sequential access" data store (such as a linked list). | 
| AbstractSet<E> | This class provides a skeletal implementation of the Setinterface to minimize the effort required to implement this
 interface. | 
| ArrayDeque<E> | Resizable-array implementation of the Dequeinterface. | 
| ArrayList<E> | Resizable-array implementation of the Listinterface. | 
| Arrays | This class contains various methods for manipulating arrays (such as sorting and searching). | 
| Base64 | This class consists exclusively of static methods for obtaining encoders and decoders for the Base64 encoding scheme. | 
| Base64.Decoder | This class implements a decoder for decoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045. | 
| Base64.Encoder | This class implements an encoder for encoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045. | 
| BitSet | This class implements a vector of bits that grows as needed. | 
| Calendar | The Calendarclass is an abstract class that provides methods
 for converting between a specific instant in time and a set ofcalendar fieldssuch asYEAR,MONTH,DAY_OF_MONTH,HOUR, and so on, and for
 manipulating the calendar fields, such as getting the date of the next
 week. | 
| Calendar.Builder | Calendar.Builderis used for creating aCalendarfrom
 various date-time parameters. | 
| Collections | This class consists exclusively of static methods that operate on or return collections. | 
| Currency | Represents a currency. | 
| Date | The class Daterepresents a specific instant
 in time, with millisecond precision. | 
| Dictionary<K, V> | The Dictionaryclass is the abstract parent of any
 class, such asHashtable, which maps keys to values. | 
| DoubleSummaryStatistics | A state object for collecting statistics such as count, min, max, sum, and average. | 
| EnumMap<K extends Enum<K>, V> | A specialized Mapimplementation for use with enum type keys. | 
| EnumSet<E extends Enum<E>> | A specialized Setimplementation for use with enum types. | 
| EventListenerProxy<T extends EventListener> | An abstract wrapper class for an EventListenerclass
 which associates a set of additional parameters with the listener. | 
| EventObject | The root class from which all event state objects shall be derived. | 
| FormattableFlags | FormattableFlags are passed to the Formattable.formatTo()method and modify the output format for Formattables. | 
| Formatter | An interpreter for printf-style format strings. | 
| GregorianCalendar | GregorianCalendaris a concrete subclass ofCalendarand provides the standard calendar system
 used by most of the world. | 
| HashMap<K, V> | Hash table based implementation of the Mapinterface. | 
| HashSet<E> | This class implements the Setinterface, backed by a hash table
 (actually aHashMapinstance). | 
| Hashtable<K, V> | This class implements a hash table, which maps keys to values. | 
| HexFormat | HexFormatconverts between bytes and chars and hex-encoded strings which may include
 additional formatting markup such as prefixes, suffixes, and delimiters. | 
| IdentityHashMap<K, V> | This class implements the Mapinterface with a hash table, using
 reference-equality in place of object-equality when comparing keys (and
 values). | 
| IntSummaryStatistics | A state object for collecting statistics such as count, min, max, sum, and average. | 
| LinkedHashMap<K, V> | Hash table and linked list implementation of the  | 
| LinkedHashSet<E> | Hash table and linked list implementation of the  | 
| LinkedList<E> | Doubly-linked list implementation of the ListandDequeinterfaces. | 
| ListResourceBundle | ListResourceBundleis an abstract subclass ofResourceBundlethat manages resources for a locale
 in a convenient and easy to use list. | 
| Locale | A Localeobject represents a specific geographical, political,
 or cultural region. | 
| Locale.Builder | Builderis used to build instances ofLocalefrom values configured by the setters. | 
| Locale.LanguageRange | This class expresses a Language Range defined in RFC 4647 Matching of Language Tags. | 
| LongSummaryStatistics | A state object for collecting statistics such as count, min, max, sum, and average. | 
| Objects | This class consists of staticutility methods for operating
 on objects, or checking certain conditions before operation. | 
| Observable | This class was deprecated
      in API level 33.
    This class and the Observerinterface have been deprecated.
 The event model supported byObserverandObservableis quite limited, the order of notifications delivered byObservableis unspecified, and state changes are not in
 one-for-one correspondence with notifications.
 For a richer event model, consider using thejava.beanspackage.  For reliable and ordered
 messaging among threads, consider using one of the concurrent data
 structures in thejava.util.concurrentpackage.
 For reactive streams style programming, see theFlowAPI. | 
| Optional<T> | A container object which may or may not contain a non- nullvalue. | 
| OptionalDouble | A container object which may or may not contain a doublevalue. | 
| OptionalInt | A container object which may or may not contain an intvalue. | 
| OptionalLong | A container object which may or may not contain a longvalue. | 
| PriorityQueue<E> | An unbounded priority queue based on a priority heap. | 
| Properties | The Propertiesclass represents a persistent set of
 properties. | 
| PropertyPermission | Legacy security code; do not use. | 
| PropertyResourceBundle | PropertyResourceBundleis a concrete subclass ofResourceBundlethat manages resources for a locale
 using a set of static strings from a property file. | 
| Random | An instance of this class is used to generate a stream of pseudorandom numbers; its period is only 248. | 
| ResourceBundle | Resource bundles contain locale-specific objects. | 
| ResourceBundle.Control | ResourceBundle.Controldefines a set of callback methods
 that are invoked by theResourceBundle.getBundlefactory
 methods during the bundle loading process. | 
| Scanner | A simple text scanner which can parse primitive types and strings using regular expressions. | 
| ServiceLoader<S> | A facility to load implementations of a service. | 
| SimpleTimeZone | SimpleTimeZoneis a concrete subclass ofTimeZonethat represents a time zone for use with a Gregorian calendar. | 
| Spliterators | Static classes and methods for operating on or creating instances of Spliteratorand its primitive specializationsSpliterator.OfInt,Spliterator.OfLong, andSpliterator.OfDouble. | 
| Spliterators.AbstractDoubleSpliterator | An abstract Spliterator.OfDoublethat implementstrySplitto permit limited parallelism. | 
| Spliterators.AbstractIntSpliterator | An abstract Spliterator.OfIntthat implementstrySplitto
 permit limited parallelism. | 
| Spliterators.AbstractLongSpliterator | An abstract Spliterator.OfLongthat implementstrySplitto permit limited parallelism. | 
| Spliterators.AbstractSpliterator<T> | An abstract Spliteratorthat implementstrySplitto
 permit limited parallelism. | 
| SplittableRandom | A generator of uniform pseudorandom values (with period 264) applicable for use in (among other contexts) isolated parallel computations that may generate subtasks. | 
| Stack<E> | The Stackclass represents a last-in-first-out
 (LIFO) stack of objects. | 
| StringJoiner | StringJoineris used to construct a sequence of characters separated
 by a delimiter and optionally starting with a supplied prefix
 and ending with a supplied suffix. | 
| StringTokenizer | The string tokenizer class allows an application to break a string into tokens. | 
| Timer | A facility for threads to schedule tasks for future execution in a background thread. | 
| TimerTask | A task that can be scheduled for one-time or repeated execution by a Timer. | 
| TimeZone | TimeZonerepresents a time zone offset, and also figures out daylight
 savings. | 
| TreeMap<K, V> | A Red-Black tree based NavigableMapimplementation. | 
| TreeSet<E> | A NavigableSetimplementation based on aTreeMap. | 
| UUID | A class that represents an immutable universally unique identifier (UUID). | 
| Vector<E> | The Vectorclass implements a growable array of
 objects. | 
| WeakHashMap<K, V> | Hash table based implementation of the Mapinterface, with
 weak keys. | 
Enums
| Formatter.BigDecimalLayoutForm | Enum for BigDecimalformatting. | 
| Locale.Category | Enum for locale categories. | 
| Locale.FilteringMode | This enum provides constants to select a filtering mode for locale matching. | 
| Locale.IsoCountryCode | Enum for specifying the type defined in ISO 3166. | 
Exceptions
| ConcurrentModificationException | This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible. | 
| DuplicateFormatFlagsException | Unchecked exception thrown when duplicate flags are provided in the format specifier. | 
| EmptyStackException | Thrown by methods in the Stackclass to indicate
 that the stack is empty. | 
| FormatFlagsConversionMismatchException | Unchecked exception thrown when a conversion and flag are incompatible. | 
| FormatterClosedException | Unchecked exception thrown when the formatter has been closed. | 
| IllegalFormatCodePointException | Unchecked exception thrown when a character with an invalid Unicode code
 point as defined by Character.isValidCodePointis passed to theFormatter. | 
| IllegalFormatConversionException | Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type. | 
| IllegalFormatException | Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments. | 
| IllegalFormatFlagsException | Unchecked exception thrown when an illegal combination flags is given. | 
| IllegalFormatPrecisionException | Unchecked exception thrown when the precision is a negative value other than -1, the conversion does not support a precision, or the value is
 otherwise unsupported. | 
| IllegalFormatWidthException | Unchecked exception thrown when the format width is a negative value other
 than -1or is otherwise unsupported. | 
| IllformedLocaleException | Thrown by methods in LocaleandLocale.Builderto
 indicate that an argument is not a well-formed BCP 47 tag. | 
| InputMismatchException | Thrown by a Scannerto indicate that the token
 retrieved does not match the pattern for the expected type, or
 that the token is out of range for the expected type. | 
| InvalidPropertiesFormatException | Thrown to indicate that an operation could not complete because
 the input did not conform to the appropriate XML document type
 for a collection of properties, as per the Propertiesspecification. | 
| MissingFormatArgumentException | Unchecked exception thrown when there is a format specifier which does not have a corresponding argument or if an argument index refers to an argument that does not exist. | 
| MissingFormatWidthException | Unchecked exception thrown when the format width is required. | 
| MissingResourceException | Signals that a resource is missing. | 
| NoSuchElementException | Thrown by various accessor methods to indicate that the element being requested does not exist. | 
| TooManyListenersException | 
 The  | 
| UnknownFormatConversionException | Unchecked exception thrown when an unknown conversion is given. | 
| UnknownFormatFlagsException | Unchecked exception thrown when an unknown flag is given. | 
Errors
| ServiceConfigurationError | Error thrown when something goes wrong while locating, loading, or instantiating a service provider. | 
- Interfaces- Collection
- Comparator
- Deque
- Enumeration
- EventListener
- Formattable
- Iterator
- List
- ListIterator
- Map
- Map.Entry
- NavigableMap
- NavigableSet
- Observer
- PrimitiveIterator
- PrimitiveIterator.OfDouble
- PrimitiveIterator.OfInt
- PrimitiveIterator.OfLong
- Queue
- RandomAccess
- SequencedCollection
- SequencedMap
- SequencedSet
- ServiceLoader.Provider
- Set
- SortedMap
- SortedSet
- Spliterator
- Spliterator.OfDouble
- Spliterator.OfInt
- Spliterator.OfLong
- Spliterator.OfPrimitive
 
- Classes- AbstractCollection
- AbstractList
- AbstractMap
- AbstractMap.SimpleEntry
- AbstractMap.SimpleImmutableEntry
- AbstractQueue
- AbstractSequentialList
- AbstractSet
- ArrayDeque
- ArrayList
- Arrays
- Base64
- Base64.Decoder
- Base64.Encoder
- BitSet
- Calendar
- Calendar.Builder
- Collections
- Currency
- Date
- Dictionary
- DoubleSummaryStatistics
- EnumMap
- EnumSet
- EventListenerProxy
- EventObject
- FormattableFlags
- Formatter
- GregorianCalendar
- HashMap
- HashSet
- Hashtable
- HexFormat
- IdentityHashMap
- IntSummaryStatistics
- LinkedHashMap
- LinkedHashSet
- LinkedList
- ListResourceBundle
- Locale
- Locale.Builder
- Locale.LanguageRange
- LongSummaryStatistics
- Objects
- Observable
- Optional
- OptionalDouble
- OptionalInt
- OptionalLong
- PriorityQueue
- Properties
- PropertyPermission
- PropertyResourceBundle
- Random
- ResourceBundle
- ResourceBundle.Control
- Scanner
- ServiceLoader
- SimpleTimeZone
- Spliterators
- Spliterators.AbstractDoubleSpliterator
- Spliterators.AbstractIntSpliterator
- Spliterators.AbstractLongSpliterator
- Spliterators.AbstractSpliterator
- SplittableRandom
- Stack
- StringJoiner
- StringTokenizer
- Timer
- TimerTask
- TimeZone
- TreeMap
- TreeSet
- UUID
- Vector
- WeakHashMap
 
- Enums
- Exceptions- ConcurrentModificationException
- DuplicateFormatFlagsException
- EmptyStackException
- FormatFlagsConversionMismatchException
- FormatterClosedException
- IllegalFormatCodePointException
- IllegalFormatConversionException
- IllegalFormatException
- IllegalFormatFlagsException
- IllegalFormatPrecisionException
- IllegalFormatWidthException
- IllformedLocaleException
- InputMismatchException
- InvalidPropertiesFormatException
- MissingFormatArgumentException
- MissingFormatWidthException
- MissingResourceException
- NoSuchElementException
- TooManyListenersException
- UnknownFormatConversionException
- UnknownFormatFlagsException
 
- Errors
