Java Basics - Polymorphism

preview_player
Показать описание
This video is an introduction to polymorphism. First I explain the concept with the help of slides then I show you code demo in Eclipse

Рекомендации по теме
Комментарии
Автор

I was so fascinated by the way you calmly showed how things work that the abrupt end caught me off guard. Thank you for showing an interesting way of presenting this, including using an array and for loop, which are both trouble spots for me at the moement.

Cheers!

gveltaine
Автор

Margret, thank you so much for taking the time to put this video series together. I'm really looking forward to new videos you decide to post. : )

portlandsound
Автор

You're an awesome instructor. Anyone with learning disabilities would understand this tutorial.

elvisronn
Автор

Margret Thank you very much.This video has answered a long time pending question that no body could answered it. Thanks. Keep up with the good clear explanations work. You keep it simple and it works for me.

bonganimanganye
Автор

Thank you! Your videos on Polymorphism have been lifesaving! Amazing job!

MrBuckethead
Автор

Good job.. the easiest to understand polymorphism example I've seen...

fordfiveohh
Автор

I posted a list of my videos at the end of the description.
Glad that you can use them for your students.

MargretPosch
Автор

Beautifully explained! Need more on the other important concepts too.
Thanks a lot.

aldrindsouza
Автор

One of Thee best!!!! keep up the good work, very clear and professional ...Thank you!!

mhlengimanqele
Автор

Note: In this context the word ‘send’ has nothing to do with computer networks. It just means that the move method implemented in class Bird is located and that the request to move is passed on to it.

Assume myAnimal is used in various methods, passed as parameter (possibly to other classes) etc.
At one point you get a new class that derived from Animal: Bat. You feel that it would be fun to have bats moving around rather than birds.
( to continue)

MargretPosch
Автор

The new derived class can be added with little or no modification to the general portion of the program. All you need to change is one single line of code:
Animal myAnimal = new Bat();
None of the method calls, method implementations, etc. need to be changed.
Why?
Because software that invokes polymorphic behavior is independent of the object type to which messages are sent.
(to continue)

MargretPosch
Автор

At 10:15, you have myAnimal.move which calls the move( ) of the bird object, even though myAnimal is of type Animal (superclass).  Since you are invoking the move ( ) of the bird object, why not just declare myAnimal to be of type bird in the first line of your method and then on the second line still use myAnimal.move ( )?

BoxerDogs
Автор

In fact, a very good example of - how to make an array of objects..too.Thanks.

whimsicalvibes
Автор

Your voice is good and good explanation....
thanking you very much :)

ganeshds
Автор

You are a time saver. Thank you for this very well explained video :)

johnathanperez
Автор

Why we use the superClass (Animal) and make diferente instansiation (new Bird(); new Fish();) for creating the object (myAnimal) in case we can use directly the specific subClass for each object

NacerCoder
Автор

Best explanation I have found, thank you

johnatoz
Автор

Whenever we call move on myAnimal, the move request is passed on to the object type that is referenced by the variable myAnimal – in our case this used to be Bird but now it is Bat.

MargretPosch
Автор

can u provide a video for encapsulation with example

kishoredubbasi
Автор

is method overloading dynamic polymorphism or sttatic polymorphism?  plzz explain the difference between static and dynamic polymorphism???

sushmitanigam