java core

Your blog category

Conversion between wrappers and primitives

Java provides a mechanism to convert between primitive data types and their corresponding wrapper classes. This conversion is categorized into two processes: Autoboxing: Converting a primitive type to its wrapper class object. Unboxing: Converting a wrapper class object to its primitive type. Conversion Methods Example Program: Demonstrating Conversion Between Wrappers and Primitives Conversion between wrappers …

Conversion between wrappers and primitives Read More »

Primitive data types

Java’s primitive data types can be categorized into four major categories: Integer Types (byte, short, int, long) Floating-Point Types (float, double) Character Type (char) Boolean Type (boolean) Example Program Java provides eight primitive data types categorized into four main groups: Integer, Floating-Point, Character, and Boolean. These data types are the building blocks of data manipulation …

Primitive data types Read More »

Reflection API

Java Reflection API is part of the java.lang.reflect and java.lang packages. It allows inspection and manipulation of classes, interfaces, constructors, methods, and fields at runtime—even if they are private. This capability is extremely useful for frameworks, development tools, and advanced operations such as serialization, dependency injection, and testing. What is the Reflection API? The Reflection …

Reflection API Read More »

The Class

The java.lang package in Java provides fundamental classes that are automatically imported into every Java program. The Class class, specifically java.lang.Class, is a core class in this package. It represents classes and interfaces in a running Java application, serving as the entry point for Java’s reflection API. Below is a detailed explanation of the Class …

The Class 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 »

CharBuffer

CharBuffer is part of the java.nio package and is a buffer for handling characters. It is useful for character-based input/output operations, such as text parsing, network communication, or file processing. It works similarly to ByteBuffer but specifically stores 16-bit char values. Commonly Used Methods Simple Program using CharBuffer Writing and Reading Characters Problem Statement: LotusJavaPrince …

CharBuffer Read More »

Scroll to Top