MIN

    [JAVA] max, min 함수

    [JAVA] max, min 함수

    java.lang.Math 클래스 내의 max, min 메소드를 사용한다. ? java.lang.Math 클래스 수학에서 자주 사용하는 상수들과 함수들을 미리 구현해놓은 클래스. Math 클래스의 모든 메소드는 static method 이므로, 객체를 생성하지 않고도 바로 사용할 수 있다. (ex. Math.min .. ) Math.max() : 두 인자 중 큰 값을 리턴 - static int max(int a , int b) - static double max(double a , double b) - static float max(float a , float b) - static long max(long a , long b) System.out.println(Math.max(1, 2)); // 2 r..