Java - Math
Math
int a = Math.max(3,5);
double r = Math.random(); // [0,1)
Use BigDecimal for currency to avoid floating-point rounding errors.
Try it
- Generate 5 random numbers and print the min/max.
- Use
BigDecimal
to add 0.1 ten times and compare withdouble
.