We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
public class MyTest {
public static void main(String args[]) {
new MyTest().doit();
}
public void doit() {
java.util.Random rand = new java.util.Random();
// random integer 0 to 10
int max = 10;
for (int i=0; i<10; i++) {
System.out.println(rand.nextInt(max + 1));
}
// random double 0 to 10
double maxd = 10;
for (int i=0; i<10; i++) {
System.out.println(maxd * rand.nextDouble());
}
}
}