랜덤 수 생성

Math 클래스 수학 관련 연산 기능을 제공하는 클래스이다. Math 클래스에 정의된 메소드는 모두 static으로 선언되어 있기 때문에, 인스턴스 생성 없이 사용할 수 있다. ex) Math.pow(10, 2) = 10 * 10 Math 클래스 메소드 메소드 종류 설명 Math.PI 원주율 Math.sqrt() 각도 Math.toRadians() 라디안 Math.sin(), cos(), tan() 매개변수가 라디안이어야 함 Math.log() 자연로그 밑이 e Math.pow(밑,지수) 밑^지수 class MathClass { public static void main(String[] args) { System.out.println("원주율: " + Math.PI); System.out.println(..
an2z
'랜덤 수 생성' 태그의 글 목록