For class types methods can be either
- instance methods, or
- static methods
So far we have looked only at instance methods.
To call either kind of method, you must use the dot operator.
For an instance method, the operand to the left of the dot must be an instance of the class.
But for a static method, no instance is needed. In that case, the operand to the left of the dot is just the class name.
The Java Math class has many static methods including:
- double sqrt(double x)
- int abs(int x)
- double abs(double x)
- double pow(double base, double exponent)
- int max(int x, int y)
- double max(double x, double y)
- int min(int x, int y)
- double min(double x, double y)