那位老大告诉我啊,为什么这个对象数组不能排序啊?
import java.util.*;
public class ArrayTest {
public static void main(String[] args) {
SortTest[] sortTest={
new SortTest(1,"aa"),new SortTest(2,"bb"),new SortTest(3,"cc")};
Arrays.sort(sortTest);
for(int i=0;i<sortTest.length;i++) {
System.out.println(sortTest[i]);
}
}}
class SortTest implements Comparable
 {
 protected int x;
 protected String name;
public SortTest(int x,String name) {
this.x=x;
this.name=name; }
public int compareTo(Object o) {
SortTest found=(SortTest)o;
return x>found.x ? 1 : (x==found.x ? 0 : -1);
}
public String toSring() {
return "x="+x+","+"name="+name;
}
  
}