请求指教。。。无知的小白的窝
public void testSort3(){
List<String> stringList =new ArrayList<String>();
String se ="zxcvbnmasdfghjklqwertyuiop1234567890QWERTYUIOPASDFGHJKLZXCVBNM";
StringBuilder st =new StringBuilder();
Random random =new Random();
int b ;
for(int i =0;i<10;i++){
b=random.nextInt(10)+1;
do{
for(int j =0;j<b;j++){
int k =random.nextInt(se.length());
st.append(se.charAt(k));
}
}while(stringList.contains(st));
}
stringList.add(st.toString());
System.out.println("--------排序前------");
for (String string : stringList) {
System.out.println("元素:"+string);
}
System.out.println("--------排序后------");
Collections.sort(stringList);
for (String string : stringList) {
System.out.println("元素:"+string);
}
}