80 likes | 232 Views
COP3502: Introduction to CIS I. Lecture 17. t omorrow: lab 3 pt. 2 n ew lab next week. e ach subclass redefines the abstract draw() method. i mplements its own version. p olymorphism (“many forms”) r eferring to each subclass as an instance of the superclass. p olymorphism (“many forms”)
E N D
COP3502: Introduction to CIS I Lecture 17
tomorrow: lab 3 pt. 2 new lab next week
each subclass redefines the abstract draw() method implements its own version
polymorphism (“many forms”) referring to each subclass as an instance of the superclass
polymorphism (“many forms”) referring to each subclass as an instance of the superclass many subclasses respond differently to the same message
Shape circ = new Circle() Is this an instance of Shape or Circle?
Shape circ = new Circle() Circle! can’t instantiate an abstract class
Shape circ = new Circle() Circle! can’t instantiate an abstract class responds to “Shape” messages and ONLY “Shape” messages