/* AdvancedHelloWorld * Andy Schwartz * COP 3330 - Fall 2006 * Sept. 8, 2006 * KEY */ public class AdvancedHelloWorld { public AdvancedHelloWorld(){ //empty constructor simply needed to create an object } //Instance Methods: public void showMessage(String yourName){ //prints the advanced hello world message System.out.println("Hello " + this.getWorld() + "!"); System.out.println("My name is " + yourName + "."); } private String getWorld(){ //returns a String of a world name of my choice return "Mars"; } //Class Methods: public static void main(String [] args){ //main method is entry into program //create an AdvancedHW object and asks it to print the message AdvancedHelloWorld ahw = new AdvancedHelloWorld(); ahw.showMessage("Andy"); } }