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

Java.util.ArrayList

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

Java.util.Arrays

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.

Java.util.BitSet

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.

Java.util.Calendar

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.

Java.util.Collections

This class contains only static methods that operate on collections or return collections.

Java.util.Currency

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.

Java.util.Date

This class represents a specific instant in Time.

Java.util.Dictionary

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.

Java.util.EnumMap

This class is for map implementation for use with enum keys. Enum maps will be maintained in the order of enum keys.

Java.util.EnumSet

This class is specialized for set utilization with Enum types.

Java.util.Formatter

This class provides support for layout justification, alignments, and formatting. However, this is not safe for multithreaded access.

Java.util.Gregoriancalendar

This is a subclass of abstract class Calendar and provides standard Gregorian Calendar format. It supports both Julian and Gregorian calendar systems.

Java.util.HashMap

It is the implementation of the map interface based on the hash table.

Java.util.HashSet

Implementation of Set interface backed by Hash Tables.

Java.util.HashTable

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.

Leave a Reply

Your email address will not be published. Required fields are marked *