Closed rdiel01 closed 5 years ago
Java will allow you to write a for loop, or conditional statement without curly brackets when you only have one statement within the loop. However, we don't recommend doing that, and have fixed the issue with this commit: 2272727d7d702c65f218cba7387a28011a94433f
I may be wrong, but I believe the second real "for loop" code example for Java is incorrect.
It currently states:
for (int i = 100; i >= 0; i -= 5) System.out.println(i);
but I believe the curly brackets are missing and it should be:
for (int i = 100; i >= 0; i -= 5) { System.out.println(i); }