
import java.util.Random;
public class RandomInteger {
// 랜덤 숫자 만들기
static void main(String[] args) {
Random random = new Random();
int randomNumber = random.nextInt(100);
System.out.println(randomNumber);
}
}
random.nextInt(100) : 0 이상 100 미만의 랜덤한 수 생성
// 범위를 지정하고 싶을 때
int randomNumber = random.nextInt(10, 51); // 10 ~ 50 사이의 랜덤 수 생성