/** * This class illustrates operator precedence * and typecasting. * * @author Erica Eddy * @version Feb. 2005 */ public class Numerics { public static void main (String[ ] args) { int a = 2, b = 9, c = 10; double x = 23.4, y = 2.5; int k = 5 - 2 + 3; System.out.println("k = " + k); double aa = 4 + 2 - 6.0; System.out.println("aa = " + aa); b = 4 % 22 + -12; System.out.println("b = " + b); x = 13 / 4 * 2.0; System.out.println("x = " + x); c = 25 % 1 / 14; System.out.println("c = " + c); y = (int)3.2/4.0; System.out.println("y = " + y); } }