next up previous
Next: The data type int Up: Unit 04 Previous: Data types in mathematics

Primitive data types in Java

To deal with numerical information, Java uses six predefined data types, called primitive numerical data types. These are int, long, short, byte, float, and double, and they allow us to represent integer and real numbers.

Java offers two additional non-numeric primitive data types: char (to represent alphanumeric characters and special symbols) and boolean (to represent the truth values true and false).

We will describe these data types in Java by specifying for each of them:

Moreover, we will specify the size of the memory occupied by a value of a certain data type, which will be significant for the numeric data types.


next up previous
Next: The data type int Up: Unit 04 Previous: Data types in mathematics