There was an error while loading. Please reload this page.
Here is the code from the code example.
package examples.b_loop; public class BasicLoop { public static void main(String[] args) throws Exception { for (int i=0; i < 5; i++) { System.out.println("Hello, World! " + i); } } }
Remember how we did loops in python? for i in range(0, 5) Does that look familiar? What would this do?
for i in range(0, 5)
Hello World! 0 Hello World! 1 Hello World! 2 Hello World! 3 Hello World! 4
Lets break this down.
int i=0;
i < 5;
i++;
Try and make some different loops.
Time to make some decisions