See if you can predict what these lines of code do. Only type it in if you need to or you want to check.
for (int i = 0; i < 7; i++) System.out.println(i); for (int i = 0; i <= 7; i++) System.out.println(i); for (int i = 7; i == 0; i--) System.out.println(i); for (int i = 7; i < 0; i--) System.out.println(i); for (int i = 7; i > 0; i--) System.out.println(i); for (int i = 0; i < 7; i--) System.out.println(i);
if you are done, you can work on Assignment 11
Open up Eclipse, if you haven't already. Create a new PROJECT.
Take screenshots and save your code for reference.
public class ForLoops { public static void main (String[] args) { int[] array = {34,52,36,4,222,-1,0,33,-42,77}; for (int i=0; i<array.length; i++) System.out.println("i = " + i + " array = " + array[i]); } }