Additional Java SE Packages

Exploring java.lang package

The java.lang package is a fundamental part of the Java programming language, providing classes that are essential for performing basic operations. It is automatically imported by default in every Java program, eliminating the need for explicit import statements. The java.lang package includes classes that handle basic data types, string manipulation, system operations, exception handling, and …

Exploring java.lang package Read More »

ByteOrder

ByteOrder is a final class that defines byte ordering—endianness—used when reading or writing multibyte data types (like int, float, etc.) into a ByteBuffer. What is Byte Order? Byte order (endianness) refers to the order in which bytes are stored in memory: Big-endian: Most significant byte is stored first. Little-endian: Least significant byte is stored first. …

ByteOrder Read More »

CompletionHandler

The CompletionHandler is an interface used for handling the result of an asynchronous I/O operation (like AsynchronousFileChannel or AsynchronousSocketChannel). Interface Definition Program 1: Simple Asynchronous File Read LotusJavaPrince wants to read a file asynchronously using AsynchronousFileChannel, and Mahesh is tasked with writing the result to the console when the operation completes successfully or fails. Problem …

CompletionHandler Read More »

Introduction to Asynchronous and Non Blocking I/O

Java I/O (Input/Output) operations play a critical role in reading data from sources (like files, sockets, or databases) and writing data to destinations (like disk files or client connections). Traditionally, Java used blocking I/O, which was simple but inefficient for high-performance or concurrent applications. To overcome this limitation, Asynchronous and Non-Blocking I/O models were introduced …

Introduction to Asynchronous and Non Blocking I/O Read More »

FileSystem

The FileSystem class is part of the java.nio.file package.It represents a file system, which provides access to file stores, file attributes, and files themselves. FileSystem acts as a factory for Path objects.It abstracts the underlying file system (e.g., Windows, Unix, ZIP file system).You don’t create FileSystem instances directly; instead, you obtain them via the FileSystems …

FileSystem Read More »

Scroll to Top