Java examples for Language Basics:Math
Find maximum of two numbers using Math.max
public class Main { public static void main(String[] args) { System.out.println(Math.max(20,40)); System.out.println(Math.max(3.4f,4.4f)); System.out.println(Math.max(6.34,13.45)); System.out.println(Math.max(499999,500000)); }//from w ww. ja v a 2 s.c o m }