Data Types in Java
A data type tells Java what kind of value a box can hold. There are primitives (raw values) and non-primitives (objects like String or your own class).
Eight primitives: byte, short, int, long, float, double, char, boolean. Day to day, use int for whole numbers and double for decimals. boolean is only true or false — not 0 and 1 like C.
String, arrays, and your classes are non-primitive. Bigger types can hold bigger numbers, but don’t pick long or float without a reason. In an exam, name the 8 primitives, then say String is a class.
Let's take this on the board with one tiny Main class — no extra files. Data Types in Java — output: 10 then 99.5 then true. int, double, boolean — three real primitives. Start from main, go line by line, and stop at each print. That output is the proof for Data Types.
Name the 8 primitives. Then say String is a class, not a primitive.