Mega Code Archive

 
Categories / Java Tutorial / Development
 

Find maximum of two numbers using Math max

public class Main {   public static void main(String[] args) {     System.out.println(Math.max(2, 4));     System.out.println(Math.max(1.4f, 1.3f));     System.out.println(Math.max(1.34, 1.45));     System.out.println(Math.max(1l, 5l));   } }