public void testSort3(){
List<String>stringList2=new ArrayList<String>();
Random d=new Random();
String n="0123456789qwertyuiopasdfghkjlzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
String m="";
for(int j=0;j<10;j++){
m="";
Integer k=d.nextInt(9)+1;
do{
for(int i=0;i<k;i++){
m=m+n.charAt(d.nextInt(62));
}
}
while(stringList2.contains(m));
stringList2.add(m);
}
System.out.println("-----------排序前------------");
for (String string : stringList2) {
System.out.println("随机字符串:"+string);
}
Collections.sort(stringList2);
System.out.println("-----------排序后-----------");
for (String string : stringList2) {
System.out.println("随机字符串:"+string);
}
}