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
public class Primitives { public static void main(String[] args) { byte b = 100; short s = 1000; int i = 42; long l = 123456789L; float f = 3.14f; double d = 3.14159; char c = 'A'; boolean bool = true; System.out.println("byte: " + b); System.out.println("short: " + s); System.out.println("int: " + i); System.out.println("long: " + l); System.out.println("float: " + f); System.out.println("double: " + d); System.out.println("char: " + c); System.out.println("boolean: " + bool); } } /* byte: 100 short: 1000 int: 42 long: 123456789 float: 3.14 double: 3.14159 char: A boolean: true */
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 in Java, each serving specific purposes based on memory size and range.Understanding these primitive data types is essential for efficient memory management and optimal program performance.Â