Another type of values that you can use in most programming languages is a type for real numbers, i.e. numbers with decimal points. These are sometimes called floating point numbers, and Java has type float. But primarily Java uses a type double for these (so-called because they can be twice as big). |
The same arithmetic operators like +, -, * and / are used. |
double x, y ; |
x = 1.5 ; |
y = x / 2.0 ; |