*9.4 (using the Random class) write a program to create a Random object with a seed of 1000, and then use the nextInt(100) method to display 50 random integers between 0 and 100. *9.4 (Using the random class) Write a program to create a random object with a seed of 1000, and then use the nextint (100) method to display 50 random integers between 0 and 100.
Reference Code:
package chapter09;import java.util.Random;publicclassCode_04{
publicstaticvoidmain(String[] args){
Random random =newRandom(1000);for(int i =0, n =0; i <50; i++, n++){
if(n %10==0)
System.out.println("");
System.out.print(random.nextInt(100)+" ");}}}
The results show that:
87357624924941456450795972833675462234122718929342494235763205295873199187929155584719558877738
Process finished with exit code 0