Java.util package consists of a collection of legacy collection classes, framework, event model, time and date facilities, internationalization and miscellaneous utility classes. There are different classes in Java.util packages and here is a brief about all of them.
java.util Packages – Java.util.ArrayDeque Class
This class gives arrays that are resizable and also implements Deque interface. Following are the features of Array Deques.
- Array Deques do not have any restrictions as far as the capacity is concerned so they can grow to any size to support usage.
- Not thread safe in the absence of external synchronization
- Concurrent access to multiple threads is not supported
- In the Array Deques, null elements are prohibited
- Faster than Stack and LinkedList
In this class, you will find resizable arrays that implement the list interface. Here are a few features of ArrayList
- Allows all elements including Null and implements every List operation
- Methods to manipulate the size of Array is available
- Constant factor is less when compared to Linked List implementation
In this class, there is a static factory which allows arrays to be viewed as lists. This class also contains various methods for manipulating Arrays and the methods throw a NullPointer Exception when the mentioned Array reference is Null.
A vector of bits will be implemented in this class which grows as per the real need. However, it is not safe to use for multithreaded use without external synchronization. NullPoint Exception will be the result whenever a Null Parameter is passed to any method in BitSet.
This is an abstract class which helps in manipulating the calendar fields. This class also provides methods and fields for implementing a concrete calendar system outside the package.
This class contains only static methods that operate on collections or return collections.
This class represents a currency and the currencies are identified by their ISO 4217 Currency Code and there will be one one instance for each currency.
This class represents a specific instant in Time.
This class is the parent of any other class and in this class, each key and each value is an object and each key is associated with at least one value.
This class is for map implementation for use with enum keys. Enum maps will be maintained in the order of enum keys.
This class is specialized for set utilization with Enum types.
This class provides support for layout justification, alignments, and formatting. However, this is not safe for multithreaded access.
This is a subclass of abstract class Calendar and provides standard Gregorian Calendar format. It supports both Julian and Gregorian calendar systems.
It is the implementation of the map interface based on the hash table.
Implementation of Set interface backed by Hash Tables.
Hashtable which maps keys to values is implemented by this class
These are the major classes in Java.util packages. There is much other class also such as Java.util.LinkedList, LinkedHashTable etc. Besides the classes provided usually in the Java.util package there are some extra classes also which are available in Java.util package extra.