Java : Data Types

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:

  1. 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.
  2. 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.

See Also: Java : Primitive Types size and default value

Java Data Types