.. This file is part of the OpenDSA eTextbook project. See .. http://opendsa.org for more details. .. Copyright (c) 2012-2020 by the OpenDSA Project Contributors, and .. distributed under an MIT open source license. .. avmetadata:: :author: Molly Domino More on Polymorphism ==================== Objectives ---------- * Review Java Interfaces and Abstract Classes * Review Inheritance and Composition * Review Overloading and Overriding * Review Reference Variables * Apply Typecasting Polymorphism Measurable Interface --------------------------------- Polymorphism Example Code ~~~~~~~~~~~~~~~~~~~~~~~~~ .. admonition:: Try It Yourself In Eclipse, use the *Project > Download Assignment...* menu command to download the exercise project named "ex07.04-MeasurableInterface". Use this example to follow along with the following video. Feel free to experiment. Refer to `01.02: Lab: LightBot for Beginners `_ if you need to review the instructions for downloading Eclipse projects. [7:23] The Measurable Interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
.. raw:: html Video Slides 7.4.1.1-JavaOOPPolyMeasurable.pdf Checkpoint 1 ------------ .. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint1Summ.html ka :long_name: Checkpoint 1 Programming Practice: Polymorphism 1 ------------------------------------ .. extrtoolembed:: 'Programming Practice: Polymorphism 1' :workout_id: 1907 Polymorphism Computer Superclass -------------------------------- [12:09] The Computer Superclass ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
.. raw:: html Video Slides 7.4.4.1-JavaOOPPolyComputer.pdf Checkpoint 2 ------------ .. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint2Summ.html ka :long_name: Checkpoint 2 Polymorphism Integer Example ---------------------------- [7:40] Java Polymorphism Integer Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
.. raw:: html Video Slides 7.6.4.1-JavaOOPPolyInteger.pdf Checkpoint 3 ------------ .. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint3Summ.html ka :long_name: Checkpoint 3 Programming Practice: Polymorphism 2 ------------------------------------ .. extrtoolembed:: 'Programming Practice: Polymorphism 2' :workout_id: 1908