/** * NestedFor --- Program that demonstrates nested For Loops and * to make changes to experimentation. * @author Blanca Polo */ public class NestedFor{ /** * Executes nested for loop. * Change the code to create the following: * create infinite loops * change for loops for while loops * make a mix of for and while nested loops * change the loops in three different ways so that it will never execute * change the loops in a way that the inner loop will never execute * change the loops in a way that the outer loop will execute only once. * @param arg A string array containing the command line arguments. * @return No return value. */ public static void main(String arg[ ]){ int j = 0; int i = 0; for(i=10; i<=20; i++){ System.out.println("---outer for i value is: " + i); for(j=1; j<=10; j++){ System.out.println(i + " x " + j + " = " + (i * j)); } //inner for loop ends System.out.println("j = " + j); System.out.println("\n-----------------------\n "); } //outer for loop ends } //closes main }// closes class NestedFor