import java.util.ArrayList;
public class MainClass {
static double getAvg(ArrayList nums) {
double sum = 0.0;
for (double itr : nums)
sum = sum + itr;
return sum / nums.size();
}
public static void main(String args[]) {
ArrayList list = new ArrayList();
list.add(10.14);
list.add(20.22);
list.add(30.78);
list.add(40.46);
double avg = getAvg(list);
System.out.println("List average is " + avg);
}
}