Java is a strictly-typed programming language. It means all variable names must be declared with Data Type before its use. Each variable with Data Type specifies allowed values and size allocated to it.
Java allowed two types of data types:
- Primitive data types: These are the most basic data type in Java, used to the building blocks of manipulation. These 8 are the primitive data types: boolean, char, byte, short, int, long, float and double.
- Non-primitive data types: The non-primitive data types are predefined or user-defined Classes, Interfaces, and Arrays.
Except for primitive type all other data type variables are non-primitive type.