Java随机生成11位手机电话号码,只需两行代码
public class Main {
public static void main(String[] args) {
String[] start = {"130", "131", "132", "133", "134", "150", "151", "155", "158", "166", "180", "181", "184", "185", "188"};
System.out.println(start[(int) (Math.random() * start.length)]+(10000000+(int)(Math.random()*(99999999-10000000+1))));
}
}