像妳壹樣寫作:
collections . sort(list,?新的?比較器& lt字符串& gt()
{
公共?int?比較(字符串?o1,?字符串?氧氣)
//在此處編寫比較方法
int?結果?=?o 1 . compare to(O2);
回歸?結果;//然後返回壹個int值。
}
});