天天看点

java 生成6位数随机数(全数字)

String code = String.valueOf((int) ((Math.random() * 9 + 1) * Math.pow(10, 5)));