' P '
id:mankozooyork
Java int arrayの逆sort (Arrays.sort(), Collections.sort())
これね。 int arrayの逆sortよく忘れる。 まあ最悪忘れたらsortしたarrayを逆ループさせてもう一回作り直せばいいだけだけど。 やり方 Collections.reverseOrder()をsortの第二引数にする。第一引数はIntegerのarray。 パターン primitive type/obj type の array - Arrays.sort() list type - Collections.sort() import …