public class Apple { private String type; public Apple (String type) { if (type.equals("")) throw new IllegalArgumentException(); this.type = type; } public String toString() { return "A " + type + " apple!"; } public static void main(String [] args) { Apple g = new Apple("Gala"); Apple f = new Apple("Fuji"); Apple rd = new Apple("Red Delicious"); java.util.ArrayList apples = new java.util.ArrayList(); apples.add(g); apples.add(f); apples.add(rd); System.out.println("My apples: " + apples); if (args.length < 1) System.exit(6); System.out.println ("Now I'll make an apple from the first cmd line arg"); Apple usersApple = new Apple(args[0]); apples.add(usersApple); System.out.println("My apples after adding yours: " + apples); } }