/** Star.java - Use loops to print some asterisks. * Let the user specify the desired number of stars as a command-line input. * 2-d: The user will specify # of rows and columns. */ public class Star { public static void main(String [] args) { int numRows = Integer.parseInt(args[0]); int numCols = Integer.parseInt(args[1]); for (int i = 0; i < numRows; ++i) { for (int j = 0; j < numCols; ++j) { System.out.print("* "); } // Tell Java to go to the next line. System.out.println(); } // Make sure we actually finish the last line of output. System.out.println(); } }