Join Peggy Fisher for an in-depth discussion in this video Using polymorphism, part of Java Essential Training for Students.
- Let's move on to Polymorphism.…The question is, what is it?…It is an odd term,…but it's actually very powerful…when you're dealing with classes and objects.…First let's talk about what it is.…So when we use inheritance to create new classes,…each new class inherits both the data members…and the methods of the superclass.…But sometimes the methods need to behave differently…depending on the new class definition.…In the case where the subclasses…may need to behave differently,…they still contain the same method name…but they have a different implementation.…
Okay.…All that's well and good…but let's talk about a real life example.…We're all familiar with animals.…So if we have an animal class and we define…three types of animals and we use animal as our…superclass and we inherit to create the subclasses:…dog, cat, and pig.…They're all animals, but when a dog speaks, it barks.…But when a cat speaks, it meows.…And finally, when a pig speaks, it oinks.…So the animal class would have a quote-unquote…generic speak method defined…
- Getting started with parsing
- Reviewing data types
- Using decisions
- Creating user-defined methods
- Command-line debugging
- Exploring the Java API
- Creating and instantiating classes
- Working with interfaces
- Storing items with arrays
Skill Level Intermediate
Q: How can I make my debugger function like the author’s?
1. Command Level Programming
2. Basics Review
4. Java API
5. Simulations and Algorithm Analysis
6. Classes and Objects
7. More on Classes
8. Data Structures
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.