public void testSort3() {
List<Student> studentList = new ArrayList<Student>();//学生集合
List<String> studentIdList = new ArrayList<String>();//学生ID集合
//生成随机不重复的1000以内ID
Random rand = new Random();
for (int i = 0; i < 3; i++) {
//String str;
do {
String str = new String(rand.nextInt(1000) + "");
} while (studentIdList.contains(str));
studentIdList.add(str);
}
}
慕粉4075985
相关分类