01: /** 02: A class for producing simple greetings. 03: */ 04: 05: public class Greeter 06: { 07: /** 08: Constructs a Greeter object that can greet a person or 09: entity. 10: @param aName the name of the person or entity who should 11: be addressed in the greetings. 12: */ 13: public Greeter(String aName) 14: { 15: name = aName; 16: } 17: 18: /** 19: Greet with a "Hello" message. 20: @return a message containing "Hello" and the name of 21: the greeted person or entity. 22: */ 23: public String sayHello() 24: { 25: return "Hello, " + name + "!"; 26: } 27: 28: private String name; 29: }