The double type stores decimal numbers (also called floating-point numbers). It uses bits and handles both massive and tiny values with fractional parts.
double price = 9.99;
double pi = 3.14159;
double temperature = -40.0;
Use double whenever you need decimal precision. Prices, measurements, scientific calculations, and averages all call for double instead of int.
Be aware that floating-point math is not always exact. 0.1 + 0.2 produces 0.30000000000000004 in Java (and most languages). For financial calculations where every cent matters, you'll need BigDecimal instead. For now, double handles everyday decimal needs well.