2.2. Polymorphism¶
2.2.1. 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
2.2.2. Interactive: Introduction to Object Oriented Programming¶
Follow Along and Engage
JavaOOPObjects.pdfDownload the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!
2.2.3. Checkpoint 1¶
2.2.4. Interactive: Java UML Diagrams¶
Follow Along and Engage
JavaOOPUML.pdfDownload the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!
UML Diagram from the example in the video
2.2.5. Programming Practice: Object Oriented Programming¶
2.2.6. Interactive: Java Inheritance: this, super¶
Follow Along, Practice and Explore
Video Slides Java OOP Super This.pdfDownload 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…”
exJavaOOP.zip
2.2.7. Checkpoint 2¶
2.2.8. Interactive: Java Inheritance: equals(), toString()¶
Follow Along and Engage
JavaOOPInheritenceEqualsToString.pdfDownload the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!
2.2.9. Checkpoint 3¶
2.2.10. Interactive: Polymorphism Measurable Interface¶
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
create a new Eclipse project, then
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
download and import the standalone *.java file(s) to the created package.
Video Slides JavaOOPPolyMeasurable.pdf
2.2.11. Checkpoint 4¶
2.2.12. Programming Practice: Polymorphism 1¶
2.2.13. Interactive: Polymorphism Computer Superclass¶
Follow Along and Engage
JavaOOPPolyComputer.pdfDownload the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!
2.2.14. Checkpoint 5¶
2.2.15. Interactive: Polymorphism Integer Example¶
Follow Along and Engage
JavaOOPPolyInteger.pdfDownload the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!