Math.random()
- Math.random() 함수는 double 형으로 0.0이상 1.0 미만 사이의 값을 반환하는 함수이다.
- ex)
System.out.println( Math.random() ); // 0.23279967568276427
System.out.println( Math.random() 10 ); // 2.3279967568276427 (0.xxx... ~ 9.xxx 까지의 값 반환)
System.out.println( (int) Math.random() 10 ); // 2 ( 0부터~9까지의 값 반환 )
System.out.println( (int) Math.random() * 10 +1 ); // 3 ( 1부터~10까지의 값 반환 )