Lecture 15
12
class OverridingDemo
•It’s often nice to override toString, to provide an informative String describing your particular kind of object
•NamedObject overrides toString (71-74)
•Create NamedObject instances named by command line arguments (33, 40)
•println …
–34 nobj.toString()
–35 nobj itself      implicit toString message
–36 toString from class Object    weird