Lecture 16
3
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
Repeat slide from last lecture. No need to spend time on it. Students who didn’t get copies of OverridingDemo.java can pick them up now, but don’t spend time rereading the code.