Additional Java SE Packages

java.util.Vector

java.util.Vector is a legacy class in the Java Collections Framework that implements a growable array of objects, meaning it can dynamically increase its size as elements are added. Introduced in the early versions of Java, Vector is synchronized, making it thread-safe by default. This means that only one thread can access the methods of a …

java.util.Vector Read More »

java.util.Hashtable

java.util.Hashtable is a legacy class in the Java Collections Framework that provides a data structure to store key-value pairs. It was part of the original version of Java and is based on the principle of a hash table, where each key is hashed internally to determine its storage location. A key feature of Hashtable is …

java.util.Hashtable Read More »

java.util.StringJoiner

StringJoiner is a class introduced in Java 8 that helps in constructing a sequence of characters separated by a delimiter with optional prefix and suffix. This eliminates manual string concatenation and makes code cleaner and more readable, especially when formatting lists or reports. Commonly Used Constructors and Methods Simple Program Problem Statement LotusJavaPrince and Mahesh …

java.util.StringJoiner Read More »

java.util.UUID

UUID (Universally Unique Identifier) is a class in java.util used to create unique identifiers that are 128-bit values, useful in distributed systems, databases, and unique object references. UUIDs are formatted as: Commonly Used Constructors and Methods Simple Program – Generate UUID Problem Statement LotusJavaPrince and Mahesh are managing a distributed document signing system for a …

java.util.UUID Read More »

java.util.Properties

java.util.Properties is a  subclass of Hashtable<Object, Object>.This is used to maintain lists of values in which both keys and values are strings.Ideal for configuration data like settings, messages, or environment variables.Often used to read/write .properties files in Java apps. Commonly used Constructors and Methods Simple Program Output Problem Statement: LotusJavaPrince and Mahesh are building a …

java.util.Properties Read More »

java.util.Scanner

The Scanner class in the java.util package is used to read input (text) from various input sources like: System.in (keyboard) Files Strings Input streams It provides parsing methods to read different types of data like int, float, double, boolean, String, etc., and is commonly used for interactive user input. Commonly Used Constructors and Methods Simple …

java.util.Scanner Read More »

java.util.Formatter

java.util.Formatter is a utility class used to format data (like numbers, strings, etc.) into formatted strings. It behaves similarly to C-style printf formatting and is often used in combination with String.format(), PrintWriter, or directly with console output. Formatter allows precise control over string formatting, such as padding, alignment, decimal precision, and locale-specific formatting. Commonly Used …

java.util.Formatter Read More »

java.util.StringTokenizer

StringTokenizer is a legacy class in the java.util package that allows you to break a string into tokens (words or parts) based on specified delimiters (e.g., comma, space, colon). It is often used for parsing text input. Although newer classes like String.split() or Scanner are recommended for modern development, StringTokenizer is still useful for simple …

java.util.StringTokenizer Read More »

java.util.Locale

The Locale class represents a specific geographical, political, or cultural region. It is used to tailor data (such as date formats, number formats, or messages) to the rules and conventions of a specific region. Each Locale object consists of: A language code (like “en” for English), An optional country code (like “US” for United States), …

java.util.Locale Read More »

java.util.Currency

The Currency class represents a currency as defined by the ISO 4217 standard. It provides information such as: Currency code (like “USD”) Symbol (like “$”) Default fraction digits (like 2 for cents in dollars) It’s immutable and thread-safe. Key Features One instance per currency (singleton per currency code) Supports getting currency by Locale or currency …

java.util.Currency Read More »

Scroll to Top