previous | start | next

Static Methods: Math

For class types methods can be either

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:



previous | start | next