@@MrSkinkarde why are you watching if you're not interested 😂
@sauravrajmitra68042 жыл бұрын
He was born to teach Java
@turuus52152 жыл бұрын
@@MrSkinkarde You're Finnish, aren't you?
@electronoob73413 жыл бұрын
My Univ. professor couldn't explain it to me like this over a whole semester! Now here I am understanding it in under 10min. Thank you!
@King-cv6mn2 жыл бұрын
Perhaps you should have come here first
@michimarz2 жыл бұрын
John has some very good videos, but this one is kinda disappointing, I'd say. It's not exactly polymorphism what John is explaining here. It's more like he's only describing inheritance. That said, I think you should have listened more carefully to your Professor instead.
@techatival Жыл бұрын
"If you can't explain it simply, you don't understand it well enough." - Albert Einstein
@Pratik_yadaw Жыл бұрын
maybe bc you love dogs and cats
@justspacing9031 Жыл бұрын
@@michimarz What? Did you even watch the video?
@Mobin922 жыл бұрын
You kinda left out the main point of Polymorphism. The conclusion should be that you can store all the different instances (e.g. of Dog, Cat, ...) in Animal variables and it still does the proper thing! Usually you e.g. have a List which contains different animals, and you can just call the eat() function on each element without worrying what type it actually is.
@travismaurice63082 жыл бұрын
Dude. You really just saved my entire life. I was having so much trouble understanding how to explain polymorphism and putting it into my own words. You explained it so perfectly in so many ways. Great content!
@mmq65252 жыл бұрын
lol entire life? a little dramatic aren't we
@smeboo9044 Жыл бұрын
@@mmq6525got somethin’ to prove now do we?
@EkThaKingMan Жыл бұрын
@@mmq6525 bros got gun to his head by boss as we watch
@feynthefallen10 ай бұрын
It's always nice to see you still got the basics down, even though I think I never EVER went and thought "I'm gonna use polymorphism on that sucker", but just went and did it.
@menaaziz273 жыл бұрын
Subscribed! with polymorphism also you can always assign a subclass object type to a super class reference type like that Animal cat = new Cat(); Animal dog = new Dog(); Animal a = new Animal(); Since Animal cat = new Cat() | | | | Reference type object type Happy coding everyone.
@MrSelmanceltiker3 жыл бұрын
Actually this is the correct explanation of polymorphism. The video content explains inheritence mechanics of OOP. Inherıtance provides child class type object act like parent class type object by inheritence. Polimorphism provides parent class type object can act like chıid class type object. Internal mechanics are very different.
@elizaalwani92002 жыл бұрын
So does the reference type or object type determine which method is used
@KaraSuraDraw12 жыл бұрын
@@elizaalwani9200 The object type
@brutusjackendy36582 жыл бұрын
@@elizaalwani9200 The object type does.
@nolan_villeneuve2 жыл бұрын
@@elizaalwani9200 the object type does. BUT the availability of methods is determined by the reference type.
@firasjab2 жыл бұрын
I think what you have described here is simply inheritance & method overloading. Polymorphism is a bit more advanced than that. You could for example have declared the cat and dog objects as Animal. That would at least have introduced the concept of polymorphism.
@insertname62 ай бұрын
What he explained could be called as polymorphism, specifically early-binding or compile-time polymorphism. What you are talking about is late binding or runtime polymorphism. Java can do both. But, yeah he did miss out on the runtime polymorphism.
@mrtoast2442 жыл бұрын
John is so concise in his teaching, my lecturer literally takes two hours to cover the exact same concepts
@eternalflames911 Жыл бұрын
memento mori
@mrtoast244 Жыл бұрын
@@eternalflames911 🖤🤍
@SoundSpaceStation2 жыл бұрын
I always wonder why University teachers spend whole semester to explain the topic but you still don't understand, but here on you tube you watch 7 minutes video about the topic and fully understand what the heck it is all about . Thank you John very much for your great content!
@eric.m57902 жыл бұрын
University teachers are not programmers. If you want to learn how to swim i think its best to learn from someone that already knows how to swim
@michimarz2 жыл бұрын
John has some very good videos, but this one is kinda disappointing, I'd say. It's not exactly polymorphism what John is explaining here. It's more like he's only describing inheritance. That said, I think you should have listened more carefully to your Professor instead.
@JJJJ-gl2uf Жыл бұрын
Surely your college teachers aren't spending an entire semester explaining one concept to you. Java [programming] doesn't come easily or quickly to everyone, maybe hit the books a bit harder or do what you're doing here: supplement your college lessons with YT videos.
@1337-p3h3 жыл бұрын
Very good videos. You explain things in ways that eliminates confusion and covers all bases.
@lisahlee56783 жыл бұрын
You have no idea how I struggled to understand this, about 5 hours before exam i stumbled upon this video, thank you. It was super easy to understand, never thought someone could explain polymorphism this way
@amphousee8 ай бұрын
2024 and this is still the best short explaination of polymorphism on KZbin.
@piotrek76337 ай бұрын
Maybe theyre wrong
@fallennarcotic69812 жыл бұрын
You have not fully understood a problem if you can not explain it to someone else. This guy is an expert in his field making the explanation affordless
@madmalik27765 ай бұрын
I struggled with understanding polymorphism after reading the entire chapter twice, but I finally grasped the concept after watching this 7-minute video. Thank you so much for the help!
@darylbaptie5159 Жыл бұрын
Thanks John! After hours of trying to find a clear explainaton you wrapped it up in 7 minutes, thanks again!
@ainsleys4402 Жыл бұрын
I don't know how to express my gratitude dude, you've saved me. I've been struggling really hard with my Java class and you have a gift for explaining in a way that scratches my brain the right way.
@vaio0072 жыл бұрын
The best Java programming youtuber !! Wish I had known his channel back in 2021 beginning when I started the programming module in Uni.. Explains way better than many of my lecturers ! Thank You !!!
@cristhianjesus897811 ай бұрын
You are an amazing teacher, know that. I've been doing a lot of java courses and these topics are always convoluted and extremely difficult to understand, but you've managed to explain in a simple way. Thanks!
@RJones-mx2oi2 жыл бұрын
I really wish I had found you and your channel months ago. Even though you are speaking fast, I am grasping and retaining the concept to write into code. Thank you so much!!!
@rizcmt1953 жыл бұрын
excellent spent 2 hours watching diff videos to understand the concept but you explained way better and way easy from all of them
@jimmysmith94622 жыл бұрын
That was such a simple explanation that was being made WAY too complicated in my class. Thank you for putting this stuff out there.
@daniaaguila98242 жыл бұрын
Hi John, thanks for your Java tutorials with non-monotone voice. If you can explain more about composition and aggregation in Java that would be great (your explanations are easier to digest compared to other youtube tutorials)!
@prathapkoththigoda94713 жыл бұрын
It was a nightmare to find a video to understand Polymorphism. Thanks a lot.
@shankar74352 жыл бұрын
I guess what was explained in the video is inheritance. As someone commented " Inherıtance provides child class type object act like parent class type object by inheritance. Polymorphism provides parent class type objects that can act like chıid class type objects. Internal mechanics are very different."
@ChrisLevi22 Жыл бұрын
this guy explained a concept in 7 minutes so much better than my professor could in 2 hours. Unreal man. Such a lifesaver
@ironbirdstudios Жыл бұрын
i usually never comment on videos, but this guy deserves it all. help me finally end my struggle with CSE 205.
@vanshika.singh.12 жыл бұрын
The fact that this was explained so perfectly and clear and it just clicked so well. Amazing job done!
@howaboutsomesoyfood2 жыл бұрын
straight to the point way of explaining this concept, most others just over-complicate it and are needlessly verbose.
@crawfishmedia2 жыл бұрын
I'm in a Java course and wasn't understanding this topic. Now its perfectly clear. THANK YOU!
@xenophage5562 Жыл бұрын
This was a fantastic explanation that I was able to wrap my head around, bravo good sir!
@Molotom3 жыл бұрын
Thanks for the video! You're helping a beginner coder in college out quite a bit :)
@NatanStarke2 жыл бұрын
Long time im out of programming life but seeing this video kinda make me happy remembering some stuff. Also very good explanations!
@hlinalina-t2i7 күн бұрын
you are wayyyyyyyy better than most of my professors. keep the good work
@agreizda43237 ай бұрын
I am currently studying for my finals exam in Germany and this is just perfectly explained. THANKS!
@maniac75912 жыл бұрын
Great explanation. I've been trying to study up for an interview (has been years since I graduated and been in a different field so I forgot everything). When I was studying it wasn't clear that method overriding and method overloading were part of Polymorphism. They made it seem like they were totally different things so thank you for clearing it up!
@NYUCODERS9 ай бұрын
He made it Simple. Thank you 😊
@eetulaakso53743 жыл бұрын
Thank you! I'm so happy that I found your video. I definetely watch other content from you, since you explain this topic so clearly. This makes so much more sense even in English compared the videos of my native language in which I just don't understand this subject at all.
@jenniferr20332 жыл бұрын
Explaining things better than youtubers with 500k+ Subscribers ...John you are doing gods work thank you so much
@roverojermainemariongilr.28563 жыл бұрын
O that's great and I'm learning more on your channel! Thank you for this! Love from the Philippines!
@RefaatIbrahimXSoftware7 ай бұрын
Polymorphism is overrider & overload Parent methods. Thank you John
@tryfonmichalopoulos56563 жыл бұрын
0:38 - "morphism" actually originates from the greek word "morphi", which directly translates into the english word "form".
@CodingWithJohn3 жыл бұрын
Cool! Got it right and didn't even know it 👍
@devangprabhune35912 жыл бұрын
You're way of explaining is playful and very expressive. ❤️ it
@tanyashankar16643 жыл бұрын
Hi,John...you made my life so easy..was struggling to understand the polymorphism concept until i found your video...much love from india
@holy87822 жыл бұрын
You've explained what this is and how to do it in half the time and made it 10x more interesting than my instructor. No insult to him. But he just made it sound way more complicated than it actually was.
@michimarz2 жыл бұрын
It's because polymorphism is unfortunately more complicated than what he's saying here.
@smaziano2 ай бұрын
Just wanted to point that you have a good sense of humor… all this based on the Kramer picture in the back… legendary
@TheRebelMerchant3 жыл бұрын
excellent video. I am a CIS student this is now starting to all make sense.
@student02062 жыл бұрын
I believe this is inheritance and not polymorphism. The subclasses of cat and dog are inheriting the superclass Animal's data fields and methods. Welp, off to find a polymorphism video! Good luck to all!
@arno54053 жыл бұрын
Well done my guy. Great video
@lootster7 ай бұрын
I don't understand why nobody can explain Polymorphism in such a simple yet elegant way!
@being_sentient Жыл бұрын
Hi. I am learning Java and I frequently drop here to get things straight. This video does a very good job of introducing polymorphism in a simple manner. But what I would also like to add, is spending some time to explain compile-time and run-time polymorphism. You can do one better by disclosing what polymorphism generally is(that is in the natural world) and how we can try to effect the same phenomenon to objects in Java (since objects in OOP languages mirror real-world objects). There are two ways to imbibe this phenomenon in an object in Java: at compile-time and run-time . The techniques of method overloading and method overriding then happened to be just a natural consequence of acheiving the desired effect. I don't know if I got it backward. I felt the emphasis should be on the phases in the lifecycle of a program.
@MyLe-wc5dg3 жыл бұрын
Heyy thank you for this video. Your pronunciation as well as explanation are really easy to understand for a Vietnamese student like me. Keep uploading more informative video please 🙏 Have a nice day ☺️☺️
@bemeb41yashsakpal90 Жыл бұрын
This guy knows the art of teaching, he explained all the concepts in such a smooth way, he makes learning fun & interesting 😇👍
@carlpilongo539 Жыл бұрын
How is this different from inheritance? Im still very confused how to differentiate them
@alexeysytnikov62207 ай бұрын
Amazing explanation, John! Can I overload a class constructor?
@jawhergannouni834111 күн бұрын
i was absent the whole semester and i understand this thing in only 7 MIN ... that's insane
@ibrahimaminu40452 жыл бұрын
Man how did i only find this channel now great content so easy to understand concepts the way you explained in this video!!
@stopfbums Жыл бұрын
Wow this is just amazing. Currently studying computer science and you help me so much!
@protocolcode27033 жыл бұрын
Thank you so much. I was looking at a video at linkedin learning an I was about to quit learning java due to that video. You made it so simple and easy. Thank you from the bottom of heart.
@yaknuelgh2 жыл бұрын
God bless any KZbinr including you John who teaches coding.
@textinface12 жыл бұрын
Amazing explanation. I'm sure you already know but your teaching skills are helping thousands of students including myself. Thank you so much!
@novanoskillz41512 жыл бұрын
wow, i have asked and "re-asked" my professor to explain this to me. and i just wasnt getting it. ive learned more in the first 3 minutes of your video then what my prof. has been trying to explain to me in 4 weeks. Thanks so much.
@thomass18912 жыл бұрын
I was going to quit my programming course and go back to working at Sonic, but then I came across your video and it just clicked. NO exaggeration, God bless you.
@Raccoon_In_A_Suit9 ай бұрын
Words fall short to convey how helpful this lecture was sir.Thank you ❤❤
@Alibeee873 жыл бұрын
Thank you for helping me get through my first year as a graduate student!
@nunya11203 жыл бұрын
Your channel is still very new, but wow, if you keep this up you're going to grow exponentially. Love your content please keep it up.
@lucifersenpai19482 жыл бұрын
Watching this video i exclaimed three times "Wow! this guy is great". Subscribed.
@increment-10 ай бұрын
2-3 uni lectures in 7 minutes, ur amazing!
@thezopelo Жыл бұрын
Thank you for the clarification on overloading vs overriding.
@wristdisabledwriter28933 жыл бұрын
I’m surprised u didn’t put @override. Can you explain when you would do that? Or if you would ever need to do that?
@CodingWithJohn3 жыл бұрын
Great question! I actually had @Override in the video but cut it since I thought it may be too confusing. I believe it's a part of the polymorphism video in the course. When overriding a method, it's always a good idea to annotate the method with @Override, but technically not necessary. It basically tells Java, "I intend to be overriding a method here." With the @Override annotation, you'll get a compilation error if that method isn't actually overriding a parent method (if you have the name or the parameters wrong or something), so it makes sure you're actually doing what you think you're doing. It also lets other developers (or future you) know that this method overrides another.
@wristdisabledwriter28933 жыл бұрын
@@CodingWithJohn great answer. Thanks
@anormalguy84073 жыл бұрын
great question and great answer, i was wondering this aswel
@carlabalos3884 Жыл бұрын
@@CodingWithJohn I thought in java you don't need an override or virtual keyword to do it. I mainly use csharp that's why. Anyway nice explanation.
@sujitsharma47923 жыл бұрын
Very well explained... It will surely lead to Subscription++
@heartoutloud74982 жыл бұрын
Ur explanations are as clean as ur code John. Thank you
@MYTHIICOOL9 ай бұрын
John you might be one of the best tutors on KZbin🙏🏼
@juicifer20242 жыл бұрын
Explaining what my comp sci professors couldn't explain during lectures...I do realize you have the benefit of hindsight and editing to make videos go a lot smoother than lectures, and there absolutely is value to lectures since we can actively ask questions and receive answers...But the way you structure your videos has been all but confusing thus far. Love this page.
@phafid Жыл бұрын
a living room and a highly knowledge guy. that's all it takes to teach people around the world
@TheRealFenwick3 жыл бұрын
Thank you so much John! you have helped me so much with my internship! Shout-out from Australia
@giaccommander74742 жыл бұрын
I learned the theory about 5 times but never had to use it because didn´t find a job as juniorDev. but this time I think I got it. THX John.
@paulsnehasish58303 жыл бұрын
for beginners: Method Overloading is categorized under Compiletime polymorphism and Method Overriding is categorized under Runtime Polymorphism
@carina.zip20022 жыл бұрын
My comp sci final is in two days and you are the only reason I'm not crying right now.
@Htman Жыл бұрын
Yoo John you are incredibly brilliant at teaching Java.
@midnaite3 жыл бұрын
I'm struggling with the instantiation of the subclass. Well, it happens that the way I learned to do my instantiations is as it follows: SubClass object = new SubClass(); But some people do it differently, and that is the way that it is represented in the official Java documentation about Polymorphism: SuperClass object = new SubClass(); And I can't figure out why is this even a possibility, because when you instantiate objects with the second way, you can't access the SubClass methods (unless they are overrided methods and have the same name in both classes). Could you explain this to me? Because I noticed that in the video you did the instantiation the same way as I do. Thanks in advance.
@CodingWithJohn3 жыл бұрын
Great question! You can certainly do both, and using the superclass as the type has the limitations you noted. Most of the time, you're just fine using the SubClass as the type, as you describe how you usually do it. However, there are situations where it makes sense to use the superclass, such as specifically when there is a polymorphic method like you noted. Let's say you had an Instrument super class, and a bunch of sub classes of Instrument like Guitar, Trombone, Drum, etc. Your Instrument class could have a play() method that makes a sound, and all subclasses would override that method with their own implementation. You could write a method that looks like this: void playSound (Instrument instrument){ System.out.println("Playing my sound: " + instrument.play()); } This method doesn't know and doesn't care what type of instrument is passed in - it just needs it to be an Instrument, so that it knows it can call its play() method. If you want to use that playSound() method in that kind of situation, you have to create your instrument like: Instrument drum = new Drum(); playSound(drum); When working with collections, you'll probably run into similar situations, just with Interfaces instead of superclasses. For example, ArrayList is an implementation of the List interface. So usually when declaring an ArrayList, you should do this: List names = new ArrayList(); This list happens to use an ArrayList as its underlying implementation, but any method that takes a List of Strings doesn't care whether you use an ArrayList, or LinkedList, or whatever. Then you can have a method like this: void printNames (List nameList) { ... } Similar to the playSound() method above, this method doesn't care whether you used an ArrayList or some other kind of List implementation - it just needs to know it's some kind of List to do what it has to do. And the user of the method can use whatever type of List they want to use for their particular situation. That's a very long answer, but hope it helps clarify it a bit!
@midnaite3 жыл бұрын
@@CodingWithJohn I can't thank you enough for this!!!! It was really helpful. Thank youu
@MyLe-wc5dg3 жыл бұрын
I am having the same question. Thank you for asking @Jorge and thank @John for the best explanation 😭😭💕
@ArskaAdventures2 жыл бұрын
I just can't believe this. John actually helps people THIS WELL in the comments. I have no words. 👍👍👍
@alanfang7665 Жыл бұрын
Thank you for explaining the topic so well..... I found your material way easier to digest than my java class! Doing God's work out there.
@patricksarmiento4016Ай бұрын
Thank you for the clear explanation and examples. My god so many videos with bad wording/explanations.
@lazarus8011 Жыл бұрын
Jonny Sins is the best at teaching programming
@R3Z3R3CT10N2 жыл бұрын
Well, enjoyed all the munchs, chomps, and noms while learing something again in a new way. Was grateful this was in my feed/recommendations.
@Lisi_Mxo Жыл бұрын
I look at topic in text book. I come here, I listen for 7 minutes. I save myself a headache. Come exam time, I just gotta chomp chomp and nom nom my way through that shit. Thank you so much, man.
@emilyoldson82133 жыл бұрын
Just found you today and am so thankful I did! Thank you!!
@nigelkay62643 жыл бұрын
i think if you make a 2-3 hour video no one, and I mean no one will ever fail java! ever again Sir John.
@zero_n_one37823 жыл бұрын
Thank you for the videos. I have humble request for you to make a clear and understandable videos regarding polymorphism via inheritance and polymorphism via interface and passing an object as argument. Thank you once again for good video.
@youvegotmail93852 жыл бұрын
My dude is awesome. Would be awesome to work under someone with his knowledge...and humor.
@verisad34722 жыл бұрын
You're really good at explaining/teaching! If I pass my midterm, I'll owe my grades to you lol
@PremChand-sb3vq6 ай бұрын
Wow!!! Extraordinary skills on explaining the concepts🎉
@myselfyuvi2 жыл бұрын
I wish I had KZbin with access to such content back when i was in college. May be i would have topped my college. 😀
@Mike----7 ай бұрын
Once again, you make me hate Java less. Your videos are indispensable. 👍
@ShivamMakwana-g7p9 ай бұрын
This man is underrated Don of java programming ❤❤❤
@kathrinm2420 Жыл бұрын
You really are a great explainer, thank you! I also didn't get the concetp at uni
@FazalMalik2 жыл бұрын
I just watched your video , I am little bit confused, you made it very easy to learn coding.
@diodesu2 жыл бұрын
Binge watching this man's videos. He's something else!
@lit_lay Жыл бұрын
I was really confused but after watching this, I realized that I have done this in my program already but I don't know it's polymorphism .. thanks
@yogeshbhagavatula51972 жыл бұрын
I hit the like button even before watching. I just know he's gonna clear everything!
@jaafarshili7869 Жыл бұрын
Thank you for the content and for being humble, keep it up :' ) Much Love.