ArrayList marks = new ArrayList(); Double sum = 0.0; sum = ((Double)marks.get(i));
Everytime I try to run my program, I get a ClassCastException th
specify your marks:
List marks = new ArrayList();
This is called generics.