随机9个*

package week;

import java.util.Random;

public class TelePhoneNumber {
public static void main(String[] args) {
Random random = new Random();
int[] nums = new int[10];
for(int i = 0 ; i < 9; i++){
System.out.print(1);
for(int j = 0; j <10 ;j++){
if(j == 0){
nums[j] = random.nextInt(7)+3;
System.out.print(nums[j]);
continue;
}
nums[j] = random.nextInt(10);
System.out.print(nums[j]);
}
System.out.println();
}
}

}

原文地址:https://www.cnblogs.com/zhenfuxing/p/10444603.html