2.9 Using the Math Class
No Answer was selected
|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.
|The Math class is part of the java.lang package and contains only static methods.
|int abs(int x)
|Returns the absolute value of an int value
|double abs(double x)
|Returns the absolute value of a double value
|double pow(double base, double exponent)
|Returns the value of the first parameter raised to the power of the second parameter
|double sqrt(double x)
|Returns the positive square root of a double value
|Returns a double value greater than or equal to 0.0 and less than 1.0
|Can be manipulated to produce a random int or double in a defined range.