public class Greeter extends Object
greet
method that takes a name
and greets that person. The message used to greet the person is a
property (field) of the Greeter
object.GreeterApp
Modifier and Type | Field and Description |
---|---|
private String |
message
The message to use in the greeting.
|
private String message
public Greeter(String message)
message
- A String
used to initialize
the Greater object with the greeting message to use.public void greet(String name)
name
- The name of the person to greet.