Objects and Classes: ISYS350 Instructor: Lei Jin
Objects and Classes: ISYS350 Instructor: Lei Jin
ISYS350
Instructor: Lei Jin
Defining Class Variables and Methods: static
public class Math public class TestMath
{ public final static double PI=3.14159; { public static void main(String[] args)
… {System.out.println(Math.PI);
public static double sqrt(double a)
System.out.println(Math.sqrt(32));
{…}
public static double random() System.out.println(Math.random()*100);
{…} }
} }