public class Randomcode {
private static String baseChars = "qwertyuiopasdfghjklzxcvbnm0123456789";
public static String getChar(int len){
String chars = "";
for(int i=0;iint baseIndex = (int)(Math.random() * baseChars.length()) + 1;
chars += baseChars.charAt(baseIndex);
}
return chars.toUpperCase();
}
}
何为随机整数?