Type a method that returns the larger of two ints
Type a method that returns the larger of two ints
Answer
public static int max(int a, int b) { return (a >= b) ? a : b; }
Every execution path returns an int. If any reachable path were missing a return, the compiler would reject it.