Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static double avg(ArrayList<Integer> list) { double sum = 0; for (int i : list) { sum += i; } return sum / list.size(); } }