---恢复内容开始---
1 public static String generateString(int length) // 参数为返回随机数的长度 2 { 3 StringBuffer sb = new StringBuffer(); 4 Random random = new Random(); 5 for (int i = 0; i < length; i++) { 6 sb.append(numberChar.charAt(random.nextInt(numberChar.length()))); 7 } 8 return sb.toString(); 9 }
---恢复内容结束---