public static int getSmall(List<ProductunitsBean> list){ int s=0; if (list!=null&&list.size()>0){ int first = list.get(0).getPerunit(); for(int i = 0; i<list.size(); i++){ if(list.get(i).getPerunit()<first){ s=i; first=list.get(i).getPerunit(); } } } return s; }
遍历集合求最小值
最新推荐文章于 2024-03-17 12:23:02 发布