提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
查找Java ArrayList的最大元素
import java.util.ArrayList; import java.util.Collections;/** from n o w j a v a . c o m**/ public class Main { public static void main(String[] args) { //create an ArrayList object ArrayList arrayList = new ArrayList(); //Add elements to Arraylist arrayList.add(new Integer("3")); arrayList.add(new Integer("1")); arrayList.add(new Integer("8")); arrayList.add(new Integer("3"));/** from 时代Java公众号 - N o w J a v a . c o m**/ arrayList.add(new Integer(