String str = "abc";
StringBuffer sb = new StringBuffer( str );
靠谱~~
我去试试你们说的。thanks
我在说's blog http://www..cn
public class Test {
public static void main(String[] args) {
String temp = "";
int i=0;
int j=0;
for (i=0;i<args.length-1;i++) {
for (j=i+1;j<args.length;j++) {
if ( (args[i].compareTo(args[j]))>0 ) {
temp=args[i];
args[i]=args[j];
args[j]=temp;
}
}
}
for (i=0;i<args.length;i++) {
System.out.println(args[i]);
}
}
}
[此贴子已经被作者于2006-8-10 23:10:01编辑过]
public class Test {
public static void main(String[] args) {
String temp = "";
int i=0;
int j=0;
for (i=0;i<args.length-1;i++) {
for (j=i+1;j>args.length;j++) {
if ( (args[i].compareTo(args[j]))>0 ) {
temp=args[i];
args[i]=args[j];
args[j]=temp;
}
}
}
for (i=0;i<args.length;i++) {
System.out.println(args[i]);
}
}
}
实现不了...你试过能实现了?
实现不了...你试过能实现了?
不好意思,写错个地方
public class Test {
public static void main(String[] args) {
String temp = "";
int i=0;
int j=0;
for (i=0;i<args.length-1;i++) {
for (j=i+1;j<args.length;j++) {
if ( (args[i].compareTo(args[j]))>0 ) {
temp=args[i];
args[i]=args[j];
args[j]=temp;
}
}
}
for (i=0;i<args.length;i++) {
System.out.println(args[i]);
}
}
}