Time:10-12
CodePudding user response:
in Java. The util package below there is a kind of Random, instantiate objects of the Random class The Random Random=new Random (); The random nextInt (10);//is greater than or equal to zero and less than 10 integers
Quote: refer to the second floor weixin_41900958 response: in Java. The util package below there is a kind of Random, instantiate objects of the Random) The Random Random=new Random (); The random nextInt (10);//is greater than or equal to zero and less than 10 integers You can to process thank you
in Java. The util package below there is a kind of Random, instantiate objects of the Random) The Random Random=new Random (); The random nextInt (10);//is greater than or equal to zero and less than 10 integers
import java.util.Random; Public class T {Public static void main (String [] args) {int i=0; Do {System. The out. Println (" first "+ (I + 1) +" is a Random number is: "+ new Random () nextInt (10)); i++; } while (i<20); } }
Page link:https//www.codepudding.com/Backend/62548.html