12/15/2008

Math

The java.lang.Math is a final class and thus no class can extend this class. The constructor of the Math class is private and thus you cannot create an instance of the Math class.
Sample
double random_number = Math.random() * 10;
System.out.println(random_number);
System.out.println("abs = " + Math.abs(random_number));
System.out.println("ceil = " + Math.ceil(random_number));
System.out.println("floor = " + Math.floor(random_number));
System.out.println("round = " + Math.round(random_number));

A result varies every time.