20 randomly generated phone number (beginning with 1)

Package Penalty for com.twod1z; 

Import java.util.Random; 

/ ** 
 * @program: com.twod1z 
 * @description: 20 randomly generated phone number 
 * @author : Mr.Lin 
 * @Create: 2019 Nian 7 Yue 30 Ri 
 * * / 
public  class telephone {
      public  static  void main (String [] args) {
             // 20 is representative of the number of cycles, generating 20 random numbers 
            for ( int I = 0; I <20 is; I ++ ) {
             // begin a defined telephone number 
            = number String ". 1" ;
             // definition of random, random number generating 
            the random random = new newThe Random ();
             for ( int J = 0; J <. 8; J ++ ) {
                 // generates a random number 0-9 
                Number random.nextInt + = (. 9 ); 
            } 
            // display output number 
            System.out.println (number) ; 
            } 
        } 

}
View Code

 

Guess you like

Origin www.cnblogs.com/lpbk/p/11271823.html