import java.util.*; // for ArrayList import java.math.*; // for BigInteger public class Ch21_10 // given a generic ArrayList, a generic method returns the largest value { public static void main(String[] args) { Random g=new Random(); ArrayList a=new ArrayList<>(); // create four different ArrayLists and populate them with values, some duplicated ArrayList b=new ArrayList<>(); ArrayList c=new ArrayList<>(); ArrayList d=new ArrayList<>(); BigInteger ten=new BigInteger("10"); // this BigInteger is used to create a new Integer String temp; // used to build a String to add to ArrayList a int temp2; // stores a random integer used to determine the size of a String or BigInteger BigInteger temp3; // temp BigInteger used to create a new one to add to ArrayList d for(int j=0;j<10;j++) { temp=""; // start with an empty String and add random letters to it temp2=g.nextInt(5)+5; // this String will be between 5 and 9 characters long for(int k=0;k> E max(ArrayList list) { E temp=list.get(0); // temp will be one element of the ArrayList, the largest found so far for(int i=1;i0) temp=list.get(i); return temp; } }