- Direct Known Subclasses:
public class Thing
- extends java.lang.Object
Thing is the top of a class hierarchy.
All Things have a name, given to them at birth.
Once born, they cannot change their name.
Things have no behavior other than producing their
Produce a String description of this instance.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Thing(java.lang.String name)
name - -- the given name of this Thing
public java.lang.String toString()
- Produce a String description of this instance.
If the class of the instance is Thing, then
return only the name of the Thing.
Otherwise add the name of the class after
the name of the thing, separated by a space.
this makes the class name of the thing serve as
the thing's last name (surname), and the given
name of the thing is its first name (given name).
toString in class
- the description of this instance