appendix> util> Random | TOPUPPREVNEXT |
java.lang.Object
└java.util.Random
コンストラクタ | 機能 |
---|---|
Random ( ) | 現在時刻(ミリ秒単位)をシードとして、乱数ジェネレータを生成します。 |
Random ( long seed ) | seed を使って、乱数ジェネレータを生成します。 同じ seed に対しては、同じ乱数列を発生させます。 |
メソッド | 機能 |
---|---|
int nextInt ( ) | 整数の一様乱数を返します。 |
int nextInt ( int n ) | 0 以上で n 未満の整数の一様乱数を返します。 |
double nextDouble ( ) | double 型の 0.0 〜 1.0 の一様乱数を返します。 |
float nextFloat ( ) | float 型の 0.0F 〜 1.0F の一様乱数を返します。 |
long nextLong ( ) | long 型の一様乱数を返します。 |
double nextGoussian ( ) | 0.0 〜 1.0 の正規分布の乱数を返します。 |
0〜9の間の整数をランダムに7個表示するプログラム。
更新日:2005-01-09