O'Reilly logo

Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) by Marcus Green, Bill Brogden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utility Classes in the java.lang Package

The Java standard library places a large number of useful classes in the java.lang package. The Java compiler automatically imports this package for all programs, so no import statement is required. Because a working knowledge of these classes is essential for any Java programmer, you have probably used many of them already, so the purpose of this section is to review their most important aspects.

The Math Class

The Math class provides the usual mathematical functions and defines the commonly used constants, e and pi, as the static double variables Math.E and Math.PI. All elements of the Math class are static, so you never create an instance of Math. The Math class is itself final and so cannot be subclassed. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required