Chapter 6 computer
Chapter 6 computer
Introduction
Java provides a Math class in the java.lang package, which contains methods to
perform mathematical operations.
These methods are static and can be accessed using the class name
(Math.methodName()).
2. Trigonometric Methods
3. Rounding Methods
Key Points
Examples
Practice Problems
1. Write a program to calculate the area of a circle using Math.PI and Math.pow().
2. Find the larger of two given numbers using Math.max().
3. Write a program to convert an angle from degrees to radians and calculate its sine
value.
4. Calculate the cube root of a number using Math.pow().