Java classes lay the foundation for your programs. The Java Math and NumberFormat classes let you program number values, as well as format numbers and currencies.
Method | Description |
---|---|
num abs(num y); | Absolute value of y (num can be any numeric data type) |
num max(num y, num z); | Maximum of y and z |
num min(num y, num z); | Minimum of y and z |
double = Math. random(); | Random number, such that 0.0 < x <= 1.0 |
Method | Description |
---|---|
NumberFormat getNumberInstance(); | Gets an instance that formats numbers. |
NumberFormat | Gets an instance that formats currency. |
String format(x); | Formats the specified number. |