.. 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

Interactive: Polymorphism Measurable Interface [7:23]
-----------------------------------------------------

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 <https://profdev-lms.tlos.vt.edu/courses/2832/assignments/10634>`_ if you need to review the instructions for downloading Eclipse projects.
   
   .. raw:: html
   
      <a href="https://courses.cs.vt.edu/~cs2114/meng-bridge/course-notes/7.4.1.1-JavaOOPPolyMeasurable.pdf" target="_blank">
      <img src="https://courses.cs.vt.edu/~cs2114/meng-bridge/images/projector-screen.png" alt="" width="32" height="32">
      Video Slides 7.4.2.1-JavaOOPPolyMeasurable.pdf</img>
      </a>


.. raw:: html

     <center>
     <iframe type="text/javascript" src='https://cdnapisec.kaltura.com/p/2375811/embedPlaykitJs/uiconf_id/52883092?iframeembed=true&entry_id=1_ywzatt7g' style="width: 960px; height: 395px" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow="autoplay *; fullscreen *; encrypted-media *" frameborder="0" title="Polymorphism Example"></iframe> 
     </center>




Checkpoint 1
------------

.. avembed:: Exercises/MengBridgeCourse/OOP2Checkpoint1Summ.html ka
   :long_name: Checkpoint 1


Programming Practice: Polymorphism 1
------------------------------------

.. extrtoolembed:: 'Programming Practice: Polymorphism 1'
   :workout_id: 1907

.. _IntroPolySuper: 

Interactive: Polymorphism Computer Superclass [12:09]
-----------------------------------------------------

.. admonition:: Follow Along and Engage

    Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

   .. raw:: html
   
      <a href="https://courses.cs.vt.edu/~cs2114/meng-bridge/course-notes/7.4.4.1-JavaOOPPolyComputer.pdf" target="_blank">
         <img src="https://courses.cs.vt.edu/~cs2114/meng-bridge/images/projector-screen.png" alt="" width="32" height="32">
         Video Slides 7.4.5-JavaOOPPolyComputer.pdf</img>
         </a>


.. raw:: html

   <center>
   <iframe type="text/javascript" src='https://cdnapisec.kaltura.com/p/2375811/embedPlaykitJs/uiconf_id/52883092?iframeembed=true&entry_id=1_pkxo2beb' style="width: 960px; height: 395px" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow="autoplay *; fullscreen *; encrypted-media *" frameborder="0" title="Polymorphism Computer Superclass"></iframe> 
   </center>


Checkpoint 2
------------

.. avembed:: Exercises/MengBridgeCourse/OOP2Checkpoint2Summ.html ka
   :long_name: Checkpoint 2



Interactive: Polymorphism Integer Example [7:40]
------------------------------------------------

.. admonition:: Follow Along and Engage

    Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

   .. raw:: html
      
         <a href="https://courses.cs.vt.edu/~cs2114/meng-bridge/course-notes/7.6.4.1-JavaOOPPolyInteger.pdf" target="_blank">
         <img src="https://courses.cs.vt.edu/~cs2114/meng-bridge/images/projector-screen.png" alt="" width="32" height="32">
         Video Slides 7.6.7-JavaOOPPolyInteger.pdf</img>
         </a>

.. raw:: html

   <center>
   <iframe type="text/javascript" src='https://cdnapisec.kaltura.com/p/2375811/embedPlaykitJs/uiconf_id/52883092?iframeembed=true&entry_id=0_33oovpxg' style="width: 960px; height: 395px" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow="autoplay *; fullscreen *; encrypted-media *" frameborder="0" title="Polymorphism Integer Example"></iframe> 
   </center>    


Checkpoint 3
------------

.. avembed:: Exercises/MengBridgeCourse/OOP2Checkpoint3Summ.html ka
   :long_name: Checkpoint 3


Programming Practice: Polymorphism 2
------------------------------------

.. extrtoolembed:: 'Programming Practice: Polymorphism 2'
   :workout_id: 1908


