// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.ArrayList;

public class Max {
    public static void main(String[] args) {
        ArrayList<Integer> lst = new ArrayList<Integer>();
        lst.add(4);
        lst.add(7);
        lst.add(2);
        lst.add(3);
        lst.add(8);
        lst.add(5);
        int max = lst.get(0);
        for(int i = 1; i < lst.size(); i++) {
            if(max < lst.get(i)) {
                max = lst.get(i);
            }
        }
        System.out.println(max);
    }
}
