1 / 8

Lecture 17

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”)

nemo
Télécharger la présentation

Lecture 17

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COP3502: Introduction to CIS I Lecture 17

  2. tomorrow: lab 3 pt. 2 new lab next week

  3. each subclass redefines the abstract draw() method implements its own version

  4. polymorphism (“many forms”) referring to each subclass as an instance of the superclass

  5. polymorphism (“many forms”) referring to each subclass as an instance of the superclass many subclasses respond differently to the same message

  6. Shape circ = new Circle() Is this an instance of Shape or Circle?

  7. Shape circ = new Circle() Circle! can’t instantiate an abstract class

  8. Shape circ = new Circle() Circle! can’t instantiate an abstract class responds to “Shape” messages and ONLY “Shape” messages

More Related