A data type is used to declare variables and specifies the type of data that can be stored. There are primitive data types like int, float, boolean and non-primitive types like String, Array, Class. Primitive types include numeric types like byte, short, int, long and floating-point types like float and double which store numbers. Non-primitive types can represent more complex data like text (String), collections of data (Array) or user-defined types (Class).