Fix four mistakes

  • 8
  • Locked
This code has four bugs, and your task is... Yeah, you already know what your task is. First of all, you need to figure out what the code does. Create something and fix the bugs that were written before you got involved with the code (as well as any that appear after you get involved).
You can't complete this task, because you're not signed in.
Comments (5)
  • Popular
  • New
  • Old
You must be signed in
AhmedLevel 17 , Amsterdam
26 May, 11:09
I think there is a bug in the validation. Because it gave me and error when I used the for each loop. When I changed it to the normal loop (same result) the validation succeeded!
RomanLevel 41
27 May, 08:18
Give me your code, please. I'll check it.
AhmedLevel 17 , Amsterdam
27 May, 10:17
change the printListValues method from using the normal loop to the for each loop This works
for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
But this should also work! But It doesn't
for (Number num : list) {
    System.out.println(num);
}
RomanLevel 41
28 May, 09:33
Look at the condition: 4. Find the block of code that uses a for loop to display the contents of the list, and move it to the printListValues ​​method. w/o changing...
AhmedLevel 17 , Amsterdam
28 May, 10:37
Ok, fair enough. But I still think it should work in both cases :-)