From dc34da2339f10a0fae9cf74851f19068d8677099 Mon Sep 17 00:00:00 2001 From: Saadullah Shahzad Date: Wed, 11 Oct 2023 16:21:10 -0400 Subject: [PATCH] Fixed Bug --- src/DataTypes.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;