일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- angular2
- 이클립스
- 25가지 효율적인 sql작성법
- 추상클래스
- 전자정부
- 가변인자
- 야구게임
- 스프링
- 로또
- Full text
- jquery
- while
- 업캐스팅
- 자바 야구게임
- 다형성
- Validations
- IBatis procedure
- 형변환
- 상속
- Random
- 자바
- Login with OAuth Authentication
- 상속예제
- 페이징
- full text indexing
- 다운캐스팅
- 전체텍스트
- 전체
- 단축키
Archives
- Today
- Total
nalaolla
Random 객체 본문
728x90
반응형
- package test.com;
- import java.util.Random;
- public class Test01Random {
- public static void main(String[] args) {
- System.out.println("Random...");
- System.out.println(Math.random()); //난수발생
- Random ran = new Random();
- System.out.println(ran.nextInt(45+1));
- System.out.println(ran.nextDouble());
- System.out.println(ran.nextBoolean());
- }
- }
============================================
랜덤객체는 Math.random과 Random클래스 두개가 존재한다..
728x90
반응형