Edit on Github instead

Java calls real numbers, like 3.1415, 4440.31, or 1.6e4, doubles.

When you write doubles, you can use numbers, one decimal place, and scientific notation (like 1.6e4) but can't use commas, percentages, dollar signs, hashmarks, or other non-numeric symbols.

Assigning a double to a variable works like this:

double d = 49592.34;
double e = -0.494;
double f = d + e;

Suggest changes

Related links

URL Topic Source