import java.util.Random; import java.io.*; public class Test_rand2{ public static void main(String[] args) throws IOException { int nran=10; System.out.println("Input: random seed"); BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); String s = buf.readLine(); long seed = Long.parseLong(s); Random rnd = new Random(); rnd.setSeed(1); System.out.println("Random Number: double (0-1)"); for (int i = 0; i <= nran-1; i++) { double ran=rnd.nextDouble(); System.out.println(ran); } System.out.println(); int max=10; System.out.println("Random Number: int (0-" +max + ")"); for (int i = 0; i <= nran-1; i++) { int ran2=rnd.nextInt(max); System.out.println(ran2); } } }