Math: max(int value1, int value2)
/* * Output: Max of -8 and -4 is -4 */ public class MainClass { public static void main(String args[]) { System.out.println("Max of -8 and -4 is " + Math.max(-8, -4)); } }