Class Person

java.lang.Object
  extended by Person
Direct Known Subclasses:
Student

public class Person
extends Object

Class the represents a person

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
Person()
          Constructor that takes no arguments
Person(String name)
          Constructor that takes a name
 
Method Summary
 String getName()
          Method to get the name
 void greet()
          Method to greet another person
static void main(String[] args)
          Main method for testing
 void setName(String someName)
          Method that sets the name
 String toString()
          Method to get an information string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Person

public Person()
Constructor that takes no arguments


Person

public Person(String name)
Constructor that takes a name

Parameters:
name - the name to use
Method Detail

setName

public void setName(String someName)
Method that sets the name

Parameters:
someName - the name to use

getName

public String getName()
Method to get the name

Returns:
the name of this person

toString

public String toString()
Method to get an information string

Overrides:
toString in class Object
Returns:
the information string

greet

public void greet()
Method to greet another person


main

public static void main(String[] args)
Main method for testing