본문 바로가기

Java/Method

Random

Method

Explain

 Random()

 System.현재시간을 Seed 값으로 사용하는 Random Instance를 생성

 Random(long seed)

 매개변수 Seed를 Seed 값으로 사용하는 Random Instance를 생성

 Boolean nextBoolean()

 boolean Type의 난수를 반환

 void nextBytes(byte[] bytes)

 Byte 배열에 Byte Type의 난수를 채워 반환

 double nextDouble()

 Double Type의 난수를 반환

 float nextGaussian()

 float Type의 난수를 반환

 double nextGaussian()

 평균은 0.0이고 표준편차는 1.0인 Gaussian 분포에 따른 double 형 난수를 반환

 int nextInt()

 int Type의 난수를 반환(int 전범위

 int nextInt(int n)

 0 ~ n 범위에 있는 int 값을 반환

 long nextLong()

 long Type의 난수를 반환(long 전범위)

 void setSeed(long seed)

 Seed 값을 매개변수를 통해 주어진 Seed 값으로 변경

 

 

'Java > Method' 카테고리의 다른 글

AWT Method I  (0) 2015.09.05
Thread  (0) 2015.08.22
Properties  (0) 2015.08.19
TreeMap  (0) 2015.08.19
HashMap  (0) 2015.08.19