1import java.util.Random;
2public class Example {
3 public static void main(String[] args) {
4 Random rd = new Random(); // creating Random object
5 System.out.println(rd.nextFloat()); // displaying a random float value between 0.0 and 1.0
6 }
7}
1public class Random {
2
3 public static void main(String[] args) {
4
5 Random random = new Random(long seed);
6 int bound = 5;
7
8 System.out.println(random.nextInt(bound));
9
10 }
11
12}
13/*
14Returns a pseudorandom, uniformly distributed int value between
150 (inclusive) and
16the specified value 5 (exclusive),
17drawn from this random number generator's sequence.