What is the data type in Java?

Data type is defined as the size and type of values that can be stored in an identifier/variable.

There are two type of data types in java :-

  1. Primitive data types: The primitive data types include boolean, char, byte, short, int, long, float and double.
  2. Non-primitive data types: The non-primitive data types include Classes, Interfaces, and Arrays.