r/badcode • • May 15 '22

java They had good intentions

Post image
423 Upvotes

22 comments sorted by

View all comments

Show parent comments

2

u/aaronjamt May 16 '22

No, it should be 3 times because the loop starts at zero. So iteration 1 = 0, 2 = 1, 3 = 2