获取Map中Value(值)的最小值和最大值

时间:2025-04-21 08:05:23

public class MapMinMaxvalue {

public static void main(String[] args) {

Map map=new HashMap();

(“2”, 5);

(“47”, 2);

(“13”, 28);

(“25”, 17);

int length =();

Collection c =();

Object[] obj=();

(obj);

(“获取Map中Value(值)的最小值======”+obj[0]);

(“获取Map中Value(值)的最大值=====”+obj[length-1]);

}

}

获取Map中Value(值)的最小值======2

获取Map中Value(值)的最大值=====28