public static void main(String[] args) {
//lambda表达式
Integer[] arr3 = {6, 2, 4, 3, 5, 1, 7, 8, 9};
/* Arrays.sort(arr3,(Integer o1, Integer o2) ->{
return o1-o2;
}
);*/
Arrays.sort(arr3, (o1, o2) -> o2 - o1);
System.out.println(Arrays.toString(arr3));
String[] str = {"aaa", "a", "aa"};
Arrays.sort(str, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return o1.length() - o2.length();
}
});
System.out.println(Arrays.toString(str));
String s1 = "a";
String s2 = "b";
int i = s1.compareTo(s2);
System.out.println(i);
}