Class Actor

java.lang.Object
  |
  +--Person
        |
        +--Actor

public class Actor
extends Person

Actor class is a subclass of the Person class.


Field Summary
protected  java.lang.String manager
          Manager of this Actor.
 
Fields inherited from class Person
gender, name
 
Constructor Summary
Actor(java.lang.String n, char g, java.lang.String m)
          Constructs an Actor object using the passed parameters.
 
Method Summary
 void act()
          this Actor acts by printing an informative message: "Actor xxx acts.", where xxx is the name of this Person.
 void laugh()
          Overrides the laugh() method of the Person class by printing: "Actor xxx laughs.", where xxx is the name of this Actor.
 java.lang.String toString()
          Overrides the toString() method of the Person class.
 
Methods inherited from class Person
sleep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

manager

protected java.lang.String manager
Manager of this Actor.

Constructor Detail

Actor

public Actor(java.lang.String n,
             char g,
             java.lang.String m)
Constructs an Actor object using the passed parameters.

Method Detail

laugh

public void laugh()
Overrides the laugh() method of the Person class by printing: "Actor xxx laughs.", where xxx is the name of this Actor. The printed informative message is different.

Overrides:
laugh in class Person

act

public void act()
this Actor acts by printing an informative message: "Actor xxx acts.", where xxx is the name of this Person.


toString

public java.lang.String toString()
Overrides the toString() method of the Person class. The manager name is also included in the returned string.

Overrides:
toString in class Person