diff --git a/src/DataTypes.java b/src/DataTypes.java index 4f807c1f..b40f5fdb 100644 --- a/src/DataTypes.java +++ b/src/DataTypes.java @@ -1,12 +1,11 @@ import java.util.List; public class DataTypes { - // TODO TASK 1: fix this code so that it passes the test in DataTypesTest.java public static long sum(List numbers) { - int s = 0; + long s = 0; // below is a "foreach" loop which iterates through numbers - for (int x : numbers) { + for (long x : numbers) { s += x; } return s;