nextInt(n) generate a random int value between 0 (inclusive) and n (exclusive)
import java.util.*;
public class Lautturi {
public static void main(String args[]) {
int rndNumber;
Random rnd = new Random(); //rnd is the name of the randomizer
rndNumber = 1 + rnd.nextInt(10); //int between 1-10
System.out.println(rndNumber);
}
}