랜덤 클래스

1. 랜덤 클래스(Random Class) - 무작위로 값을 생성해내는 내부 알고리즘을 지닌 클래스 - import java.util.Random; 를 입력 2. 랜덤 클래스의 기능 - Random( ) : 랜덤한 값 생성 - nextInt( ) : 랜덤한 값 출력 (100을 넣으면 100중에서 출력) // Example package smaple; import java.util.Random; public class Main { public static void main(String[] args) { Random a = new Random();// 랜덤한 값 생성 for(int i = 0; i < 5; i++) { // 종자값(seed) : 이 것을 토대로 구해서 줌 System.out.println(a..
NewBean
'랜덤 클래스' 태그의 글 목록