// Allison Obourn, CSE 142 // Demonstrates using math methods and type casting public class MathExamples { public static void main (String[] args) { System.out.println(Math.abs(-54)); double squareRoot = Math.sqrt(365); double p1 = Math.pow(5, 3); double p2 = Math.pow(5, 6); System.out.println("The powers are " + p1 + " " + p2); // System.out.println((String) + 2); // above line is illegal; you cannot cast an int to a String System.out.println((double) 5 / 10); } }