RandomIntpublic class RandomInt extends Object Generate random ints by asking Random() for
a series of random integers from 1 to 10, inclusive. |
Methods Summary |
---|
public static void | main(java.lang.String[] a)
Random r = new Random();
for (int i=0; i<1000; i++)
// nextInt(10) goes from 0-9; add 1 for 1-10;
System.out.println(1+r.nextInt(10));
|
|