集册 Java实例教程 使用Math.max查找两个数的最大值

使用Math.max查找两个数的最大值

欢马劈雪     最近更新时间:2020-01-02 10:19:05

580
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用Math.max查找两个数的最大值
/*N o w J a v a . c o m 提 供*/


 

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));

  }

}