Public Static voidMain (string[] args) {Test T =NewTest (); for(inti =0; I < -; i++) //randomly generate 100 mobile phone numbers {System. out. println (T.getphone ()); } } /** * Randomly generate 11-digit mobile phone number*/ Publicstring Getphone () {string move []={"134","135","136","137","138","139"," Max","151"," the","157","158","159","187","188"}; String Unicom []={" the","131"," the","155","156","185","186","145"}; String Telecom []={"133","153"," the","181","189"}; String tel[][]={Mobile, unicom, telecom}; Random Rd=NewRandom (); intindex = Rd.nextint (tel.length);//Number of Operators intSize = Rd.nextint (tel[index].length);//number of operator numbersString phone=tel[index][size]+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten)+""+rd.nextint (Ten); returnphone; }
Randomly generate mobile phone numbers