double

Java's primitive type for numbers with a fractional part, stored in 64-bit binary floating point.

In more detail

double is fast and fine for measurements, but binary fractions cannot represent most decimal amounts exactly, so 0.1 plus 0.2 is not exactly 0.3. Money should use whole cents in a long or the BigDecimal class instead.

Example

double ratio = 0.75;

Related terms

Taught in

References

Certification courses