/* File: HelloWorldGood.java - March 2016 */ package l04; /** * A recursive algorithm that prints out "Hello World!" a fixed * number of times (followed by the same number of "Done"). * * Sample usage: java l04.HelloWorldGood 10 * * @author Michael Albert * */ public class HelloWorldGood{ public static void main(String[] args) { helloWorld(Integer.parseInt(args[0])); } public static void helloWorld(int n) { if (n <= 0) return; System.out.println("Hello World"); helloWorld(n-1); System.out.println("Done"); } }