我注意到一个对我来说奇怪的行为,即使用Arrays.asList()
检索列表进行排序时。似乎在使用Collections.sort(list)
之后,原始数组也被排序了!
这是怎么可能的呢?
List<Rate> rates = Arrays.asList( arrayRates );
Collections.sort( rates, new RateEffectiveDateComparator() );
/* after that the rates list AND arrayRates array are sorted in the same way */