My Java Quiz

The ultimate place to learn Java!

Question #78: What will the code below print?

List a=Arrays.asList(1,2,3);
a.remove(1);
a.add(4);
Integer sum = 0;
for (Integer temp : a) {
    sum += temp;
}
System.out.println(sum);