- 単純な乱数
new Random().nextXxx();
new Random().nextXxx(10);
- 重複なし乱数リスト
new Random().ints(0, Integer.MAX_VALUE)
.distinct()
.limit(10)
.boxed()
.collect(Collectors.toList())
- リスト乱数取得
list.get(random.nextInt(list.size()));
More than 3 years have passed since last update.
new Random().nextXxx();
new Random().nextXxx(10);
new Random().ints(0, Integer.MAX_VALUE)
.distinct()
.limit(10)
.boxed()
.collect(Collectors.toList())
list.get(random.nextInt(list.size()));
Register as a new user and use Qiita more conveniently