About Lesson
It contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).
Important Components of java.util Package
Collections Framework
- Interfaces: Core interfaces of the collections framework include
Collection
,List
,Set
,Map
,Queue
, andDeque
. - Classes: Concrete implementations of these interfaces, such as
ArrayList
,LinkedList
,HashSet
,TreeSet
,HashMap
,TreeMap
,PriorityQueue
, andArrayDeque
. - Utility Classes:
Collections
class provides static methods for sorting, searching, reversing, and other operations on collections.
Date and Time Utilities
- Date: Represents a specific instant in time, with millisecond precision.
- Calendar: Provides methods for manipulating dates and times in a more flexible manner than
Date
. - TimeZone: Represents a time zone offset, and also handles daylight saving adjustments.
- GregorianCalendar: A concrete subclass of
Calendar
, used for date and time calculations.
Event Handling
- EventObject: The root class for all event state objects.
- EventListener: A tagging interface for event listener classes.
Miscellaneous Utilities
- Random: Generates pseudo-random numbers.
- Scanner: Parses primitive types and strings using regular expressions.
- Properties: A subclass of
Hashtable
used to maintain lists of values in which the key is aString
and the value is also aString
.