Additional Java SE Packages

java.util.BitSet

BitSet is a class in the java.util package that implements a vector of bits that grows as needed. Each component of the bit set has a boolean value (true for 1 and false for 0). It is useful for storing flags, manipulating binary data, or working with sets efficiently using bit-level operations. Key Features: Dynamic …

java.util.BitSet Read More »

java.util.Random

The Random class is part of the java.util package and is used to generate pseudo-random numbers of different types: int, long, float, double, boolean, and Gaussian values. Based on a 48-bit seed using a linear congruential formula. Thread-safe only if externally synchronized. Can generate both bounded and unbounded values. Commonly Used Methods Simple Program: Lottery …

java.util.Random Read More »

java.util.TimeZone

The java.util.TimeZone class represents a time zone offset and also figures out daylight saving time adjustments. It is used in conjunction with Calendar, Date, and the formatting classes. Commonly Used Methods Common Time Zone IDs Examples “UTC” “GMT” “Asia/Kolkata” “America/New_York” “Europe/London” For More Time Zone ID’s https://docs.oracle.com/middleware/1221/wcs/tag-ref/MISC/TimeZones.html Simple Example Problem Statement:Listing All TimeZones with GMT …

java.util.TimeZone Read More »

java.util.Calendar

The java.util.Calendar class is an abstract class used to perform date and time arithmetic such as adding days, months, or retrieving specific fields (like year, month, day, etc.). It provides more functionality than java.util.Date and was introduced to overcome some limitations of the Date class. Key Features: Allows field-level manipulation (like setting specific year, month, …

java.util.Calendar Read More »

java.util.Date

The java.util.Date class represents a specific instant in time, with millisecond precision. It was part of the original Java 1.0 and is located in the java.util package. Although many of its methods are deprecated in favor of the newer java.time API (Java 8+), it’s still widely used, especially when interacting with legacy systems or older …

java.util.Date Read More »

Collection Framework interfaces and classes

The Java Collection Framework provides a set of interfaces and classes for managing groups of objects. It simplifies data manipulation, such as storing, retrieving, and processing data. The framework is built around a few core interfaces and their implementing classes, which can be broadly categorized into lists, sets, queues, and maps. For more relavant practice …

Collection Framework interfaces and classes Read More »

Exploring java.util package

The java.util package in Java is a fundamental part of the Java Standard Library, providing a collection of utility classes that support various data structures, algorithms, and other functionalities. This package is crucial for efficient data management and manipulation in Java applications.Here’s a comprehensive overview of its key components: 1.Collections Framework The java.util package includes …

Exploring java.util package Read More »

DateFormatSymbols

The DateFormatSymbols class (in java.text) provides locale-specific data used by DateFormat classes, such as: Month names Day names AM/PM markers Era strings It allows customization of how date and time values are formatted or parsed. Key Features: Helps DateFormat with textual date elements like months and days. Locale-sensitive. Customizable for creating localized or specialized date …

DateFormatSymbols Read More »

Format

The Format class (in java.text) is an abstract base class used for formatting and parsing locale-sensitive information like numbers, dates, messages, and text. It provides a common interface for all formatting subclasses such as DateFormat, NumberFormat, MessageFormat, etc. Key Features: Serves as the superclass for all formatter classes. Defines the standard methods for formatting objects …

Format Read More »

Scroll to Top