LaunchCodeEducation / skills-back-end-java

Unit 3 (Java Track) of the LC101 Curriculum, following fundamentals in Python
http://education.launchcode.org/skills-back-end-java/
Other
17 stars 31 forks source link

Java4python control flow #22

Closed rdiel01 closed 5 years ago

rdiel01 commented 6 years ago

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); }

pdmxdd commented 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