package iso;
import java.util.Random;
public class Test5 {
/** * 产生随机数
* * @param randomLength
* @return
*/
public static String randomChars(int randomLength) {
char[] randoms = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
Random random = new Random();
StringBuffer ret = new StringBuffer();
for (int i = 0; i < randomLength; i++) {
ret.append(randoms[random.nextInt(randoms.length)]);
}
random = null;
return ret.toString();
}
public static void main(String[] args) {
Test5 t5 = new Test5();
System.out.println(t5.randomChars(1));
}
}