// Maximum.java: demonstrate using the max method // from the Liang textbook public class Maximum { /** Main method */ public static void main(String[] args) { int i = 5; int j = 10; int k = max(i, j); System.out.println("The max of "+i+" and "+j+ " is "+k); System.exit(0); } /** Return the max between two numbers */ public static int max(int num1, int num2) { int result; if (num1 > num2) result = num1; else result = num2; return result; } }