public List<Map.Entry<Integer,BigDecimal>> sortByMapValue(HashMap<Integer, BigDecimal> map){ ArrayList<Map.Entry<Integer, BigDecimal>> list = new ArrayList<>(map.entrySet()); Collections.sort(list, new Comparator<Map…
没做出来 第四题 (List)写一个函数reverseList,该函数能够接受一个List,然后把该List 倒序排列. 例如: List list = new ArrayList(); list.add(“Hello”); list.add(“World”); list.add(“Learn”); //此时list 为Hello World Learn reverseList(list); //调用reverseList 方法之后,list 为Learn World Hello package…
package homework004; import java.util.ArrayList; import java.util.List; public class Daoxu { public void reverseList(List<String> list) { List<String> list1 = new ArrayList<>(); for(int i =list.size()-1;i>=0;i--) { list1.add(list.get(…