SMALL 공부1 TIL 230314(화) Math클래스, 래퍼 클래스, 문자열 숫자로변환, 오토박싱, 언박싱 Math클래스 : 기본적인 수학계산에 유용한 메소드로 구성됨 Math클래스의 메소드는 모두 static이며, 2개의 상수만 정의해 놓았음 public static final double E = 2.7182818284590452354; // 자연로그의 밑 public static final double PI = 3.14159265358979323846; // 원주율 Math의 메소드 메소드 / 설명 예제 결과 static double abs(double a) static float abs(float f) static int abs(int f) static long abs(long f) : 주어진 값의 절대값을 반환 int i = Math.abs(-10); double d = Math.abs(-10.0); .. 2023. 3. 14. 이전 1 다음 LIST