public static long buildRandom(int length) {
long num = 1;
double random = Math.random();
if (random < 0.1) {
random = random + 0.1;
}
for (int i = 0; i < length; i++) {
num = num * 10;
}
return (long) ((random * num));
}
参考资料:https://www.cnblogs.com/jdbn/p/10089719.html
浙公网安备 33010602011771号