To save people constantly looking up how to do loops in the lecture notes, here’s a simple example that prints the numbers 0 to 4 inclusive. As a for loop: for(int i=0; i<5; i++) { System.out.println(i); } As a while loop: int i=0; while(i<5) { System.out.println(i); i++; }