Answer:
random1 = randGen.nextInt(10);
random2 = randGen.nextInt(10);
The value of 10 as a scaling factor is used because counting 0 - 9 inclusive, we have 10 possibilities.
Step-by-step explanation:
// Random class is imported to allow the program generate random object
import java.util.Random;
//The class definition
public class Solution {
// main method is defined which signify beginning of program execution
public static void main(String[ ] args) {
// Random object called randGen is declared
Random randGen = new Random();
// random variable 1
int random1;
// random variable 2
int random2;
// random1 is generated and printed
System.out.println(random1 = randGen.nextInt(10));
// random2 is generated and printed
System.out.println(random2 = randGen.nextInt(10));
}
}