Please enable JavaScript to use CodeHS

IB SL Glossary

Flashcards

Course:

Module:

Lesson:

Search:

Static Methods Java

Static methods are the methods in Java that can be called without creating an object of class. Static methods are called using the dot operator along with the class name unless they are defined in the enclosing class.

Math Class Java

The Math class is part of the java.lang package and contains only static methods.

int abs(int x) Java

Returns the absolute value of an int value

double abs(double x) Java

Returns the absolute value of a double value

double pow(double base, double exponent) Java

Returns the value of the first parameter raised to the power of the second parameter

double sqrt(double x) Java

Returns the positive square root of a double value

double random() Java

Returns a double value greater than or equal to 0.0 and less than 1.0

Math.random Java

Can be manipulated to produce a random int or double in a defined range.