.. 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
Polymorphism
============
Objectives
----------
* Create and use objects in java
* Review Java Interfaces and Abstract Classes
* Review Inheritance and Composition
* Review Overloading and Overriding
* Review Reference Variables
* Trace and program using inheritance
* Trace and implement equals and toString methods
* Trace coding examples of polymorphism
* Design java classes using polymorphism
* Apply Typecasting
.. _IntroOOP:
Interactive: Introduction to Object Oriented Programming
---------------------------------------------------------
.. 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
JavaOOPObjects.pdf
.. raw:: html
Checkpoint 1
------------
.. avembed:: Exercises/SWDesignAndDataStructs/OOP1Checkpoint1Summ.html ka
:long_name: Checkpoint 1
.. _IntroUML:
Interactive: Java UML Diagrams
------------------------------
.. 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
JavaOOPUML.pdf
UML Diagram from the example in the video
.. raw:: html
.. _IntroInheritance:
Interactive: Java Inheritance: this, super
--------------------------------------------------
.. admonition:: Follow Along, Practice and Explore
Download to run and explore the corresponding project from the video on your own in eclipse. The project CS2-Support is required for the sample project above. It is also used in your course projects. To download the CS2-Support you must first complete the configuration steps for your first lab. You will then be able to download it via eclipse using the blue down arrow icon or using the Project Menu and selecting "Download Assignment..."
.. raw:: html
Video Slides Java OOP Super This.pdf
exJavaOOP.zip
.. raw:: html
Checkpoint 2
------------
.. avembed:: Exercises/SWDesignAndDataStructs/OOP1Checkpoint2Summ.html ka
:long_name: Checkpoint 2
Programming Practice: Object Oriented Programming
-------------------------------------------------
.. extrtoolembed:: 'Programming Practice: Object Oriented Programming'
:workout_id: 1906
Interactive: Java Inheritance: equals(), toString()
---------------------------------------------------
.. 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
JavaOOPInheritenceEqualsToString.pdf
.. raw:: html
Checkpoint 3
------------
.. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint3Summ.html ka
:long_name: Checkpoint 3
.. _IntroPolyMeasure:
Interactive: Polymorphism Measurable Interface
----------------------------------------------
.. admonition:: Try It Yourself
Download to run and explore the java file (see below) from the video on your own in eclipse. You may download the standalone \*.java file for this example. To run the standalone \*.java file you will need to
1) create a new Eclipse project, then
2) create a package within the project called “example” (the package named at the top of the class MUST match the package the file is placed in within the Eclipse project), and finally
3) download and import the standalone \*.java file(s) to the created package.
.. raw:: html
Video Slides JavaOOPPolyMeasurable.pdf
.. raw:: html
Checkpoint 4
------------
.. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint4Summ.html ka
:long_name: Checkpoint 4
Programming Practice: Polymorphism 1
------------------------------------
.. extrtoolembed:: 'Programming Practice: Polymorphism 1'
:workout_id: 1907
.. _IntroPolySuper:
Interactive: Polymorphism Computer Superclass
---------------------------------------------
.. 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
JavaOOPPolyComputer.pdf
.. raw:: html
Checkpoint 5
------------
.. avembed:: Exercises/SWDesignAndDataStructs/OOP2Checkpoint5Summ.html ka
:long_name: Checkpoint 5
.. _IntroPolyExample:
Interactive: Polymorphism Integer Example
-----------------------------------------
.. 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
JavaOOPPolyInteger.pdf
.. raw:: html
Programming Practice: Polymorphism 2
------------------------------------
.. extrtoolembed:: 'Programming Practice: Polymorphism 2'
:workout_id: 1908