package com;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
//初始化数组
List nums = new ArrayList();
nums.add(2);
nums.add(5);
nums.add(10);
nums.add(6);
nums.add(3);
//设置最大值Max
int Max = Collections.max(nums);
System.out.println(“Max = ” + Max);
}
}
public Integer getBoxNumto() {
List<Integer> nums = new ArrayList<Integer>();
for(NormalSample sample : normalSamples){
nums.add(sample.getBoxNoto());
}
int Max = Collections.max(nums);
return Max;
}