1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Java

Connected

Exercise

Batch Changing

You have found the correct box to change. Hurray ! Unfortunately, with a forEach loop, you cannot easily change the content. To that end, you slightly change your program and use a for loop. The weight of the new bag is 198.

Instructions

100 XP
  • Write down the correct limit for the iterator.
  • Input the correct index to change the list weights. It should work even if the element's position changes.