Production test1
Summary by Bito
This pull request modifies two existing Java classes, LoopBugsDemo.java and LoopBugsExtra.java, to update loop conditions and fix array access issues, while demonstrating various loop-related behaviors. The changes introduce fixes for out-of-bounds errors but also modify loop logic that may lead to infinite loops in some cases.
Detailed Changes
- Introduces an assignment in do-while loop condition in LoopBugsExtra.java (do-while loop), potentially causing an infinite loop by setting n = 3 instead of comparing n != 0.
- Fixes array out-of-bounds error in LoopBugsDemo.java by changing for loop condition from i <= arr.length to i < arr.length.
- Modifies for loop in LoopBugsExtra.java to increment j instead of decrement, preventing potential infinite loop during array traversal.
- Adjusts while loop condition in LoopBugsExtra.java from k-- > 0 to k > 0, altering the loop execution logic.
Edited by gitlab_custom_domain