如果你使用JDK8,因為 Comparator 介面需要實作的只有一個 compare 方法,因此若使用 sort 方法時要指定 Comparator ,可以使用Lambda 語法來讓它更簡潔一些:
確定! 回上一頁