怎么不能实现字符串排序?
public class chsort{
public static void main(String [] args)
{
String str="kbcafeg";
StringBuffer s1=new StringBuffer(str);
s1.reverse();
System.out.println(s1);
char s;
int i,j,n;
n=s1.length();
char ch[]=new char[n];
for(i=0;i<s1.length()-1;i++)
{
ch[i]=s1.charAt(i);
for(j=i+1;j<s1.length();j++)
{
ch[j]=s1.charAt(j);
if(ch[i]>ch[j])
{
s=ch[i];
ch[i]=ch[j];
ch[j]=s;
}
}
System.out.println(ch);
}
System.out.println(ch);
}
}
怎么不能排序呀???????