Labs
- Write a new Java program. In its
maincheck to see if exactly one argument was passed on the command line and if not, exit with an appropriate message.
Otherwise, convert the argument to an int using the code
int count = Integer.parseInt(args[0]);
and then use a for loop to print the numbers from 1 to the given number.
(Solution: solutions/CountTo.java)