获取返回对象的 最大值 与 位置下标
List<Integer> guo = new ArrayList();
List<Double> jin = new ArrayList();
for (int i = 0; i < MonthlyIncome_One.size(); i++) {
Integer mout = Integer.valueOf(MonthlyIncome_One.get(i).getOPT_MON());
Double mouts = Double.valueOf(MonthlyIncome_One.get(i).getValue());
guo.add(mout);
jin.add(mouts);
}
Double[] strings = (Double[]) jin.toArray(new Double[0]);
Integer[] stringss = (Integer[]) guo.toArray(new Integer[0]);
String qqq = null;
if (strings.length > 0) {
double sum_Max = strings[0], sum_index = 0;
for (int i = 0; i < strings.length; i++) {
if (strings[i] > sum_Max) {
sum_Max = strings[i];
sum_index = i;
}
}
qqq = String.valueOf(sum_index);
}
int index = qqq.lastIndexOf(".");
String str_Num = qqq.substring(0, index);
int num = Integer.valueOf(str_Num);
int cc = stringss[num];
![比较所有月份中金额值 返回最大金额值得月份](https://img-blog.csdnimg.cn/2020042110455734.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzE4NTUyMQ==,size_16,color_FFFFFF,t_70#pic_center)