コレクションと配列をソート
・コレクション(List)のソート
import java.util.Collections; List<Integer> ls = new ArrayList<Integer>(); Collections.sort(ls); Collections.reverse(ls); // 逆順にする
・配列のソート
import java.util.Arrays;
Arrays.sort(arr);
・コレクション(List)のソート
import java.util.Collections; List<Integer> ls = new ArrayList<Integer>(); Collections.sort(ls); Collections.reverse(ls); // 逆順にする
・配列のソート
import java.util.Arrays;
Arrays.sort(arr);