8.7 Polymorphism in Java

  Рет қаралды 277,742

Telusko

Telusko

Күн бұрын

What is Polymorphism?
The ability of an object to take on many forms is known as polymorphism.
The word "poly" means many and "morphs" means behavior. So polymorphism means many behavior.
Types of polymorphism : compile time polymorphism and runtime polymorphism.
Check out our website: www.telusko.com
Follow Telusko on Twitter: / navinreddy20
Follow on Facebook:
Telusko : / teluskolearnings
Navin Reddy : / navintelusko
Follow Navin Reddy on Instagram: / navinreddy20
Subscribe to our other channel:
Navin Reddy : / @navinreddy
Telusko Hindi :
/ @teluskohindi
Subscribe to the channel and learn Programming in easy way.
Java Tutorial for Beginners : goo.gl/p10QfB
Scala Tutorials for Java Developers : goo.gl/8H1aE5
C Tutorial Playlist : goo.gl/8v92pu
Android Tutorial for Beginners Playlist : goo.gl/MzlIUJ
XML Tutorial : goo.gl/Eo79do
Design Patterns in Java : goo.gl/Kd2MWE
Socket Programming in Java : goo.gl/jlMEbg
Spring MVC Tutorial : goo.gl/9ubbG2
OpenShift Tutorial for Beginners : goo.gl/s58BQH
Spring Framework with Maven : goo.gl/MaEluO
Sql Tutorial for Beginners : goo.gl/x3PrTg
String Handling in Java : goo.gl/zUdPwa
Array in Java : goo.gl/uXTaUy
Java Servlet : goo.gl/R5nHp8
Exception Handling in Java : goo.gl/N4NbAW

Пікірлер: 208
@anaskala1196
@anaskala1196 6 жыл бұрын
I am wondering about my father's reaction, when I tell him that his mobile phone is my mobile phone.
@rajatpradhan9219
@rajatpradhan9219 5 жыл бұрын
Lol😆!!
@McLovinBillion
@McLovinBillion 4 жыл бұрын
That was probably the worst example of inheritence and polymorphism 😂😂😂
@chintanSharma29.02
@chintanSharma29.02 4 жыл бұрын
*Flying Chappal Appears*
@jhansiravipati1698
@jhansiravipati1698 4 жыл бұрын
HAHAHAHAH
@giorgi23
@giorgi23 3 жыл бұрын
As nowadays mobiles phones are almost our identity this is true, but in 2005 we could share our phones easily :))))
@miguelunch4
@miguelunch4 6 жыл бұрын
Thank you so much, you make it so easy to learn. Even though it's obvious that you're an expert your explanations can be easily understood by beginners Seriously, thank you.
@ekanshmishra4517
@ekanshmishra4517 3 жыл бұрын
One of the best explanation of such difficult topics.. thank you sir🙏
@RealNaps
@RealNaps 4 жыл бұрын
I LOVE THE EXAMPLE OF YOUR PHONE, IT MADE EVERYTHING CRIPSY
@mamtarani8331
@mamtarani8331 4 жыл бұрын
Omg finally method overriding concept is cleared.... Thank you so much sir for explaining with the easiest way
@rikinshah5367
@rikinshah5367 7 жыл бұрын
He said "IF WE ARE HUMANS" means when he says "HELLO ALIENS" he actually means it lmao
@BigyanChap
@BigyanChap 6 жыл бұрын
I literally laughed for 1 minute straight as I read your comment.
@amanburnwal6151
@amanburnwal6151 6 жыл бұрын
i want someone to comment on this....lol
@kusumachallaa9876
@kusumachallaa9876 4 жыл бұрын
😁
@anjaneyanaik761
@anjaneyanaik761 6 жыл бұрын
Best professor for Java 😍
@Icecodes
@Icecodes 5 жыл бұрын
I agree he needs a Udemy course.
@shobhitranjan2938
@shobhitranjan2938 3 жыл бұрын
@@Icecodes he have
@shreypatel920
@shreypatel920 6 жыл бұрын
You are really good at giving examples
@geethanjalibaskaran3028
@geethanjalibaskaran3028 5 жыл бұрын
Perfect example and I clearly learned the concepts.
@mohamedhassan7849
@mohamedhassan7849 4 жыл бұрын
Actually it's very funny after i listen a full lecture and get nothing if not confuse hhhhhhhhhh but the time i watched this 9min lecture i got whole concept and am hereby thanking you brother. UNCOUNTERBLE THANKS MAN.
@shankarprasadchatterjee4286
@shankarprasadchatterjee4286 4 жыл бұрын
Wonderful sir Who can make such complex concept so easily
@dnyaneshwarkadam6823
@dnyaneshwarkadam6823 5 жыл бұрын
Navin sir lot's of thanks for opp's (polymorphism) concept... I understand this concept very simply because of you. Really thanks 😊.............
@yaswanthmanikanta664
@yaswanthmanikanta664 4 жыл бұрын
best professor of java thank u sir for helping us
@sai5926
@sai5926 6 жыл бұрын
Excellent explanation about polymorphism Naveen garu
@bijoyaroy4559
@bijoyaroy4559 4 жыл бұрын
Overloading is static polymorphism, compile time and overriding is dynamic polymorphism, runtime
@raaoohin863
@raaoohin863 2 жыл бұрын
public class A { public void printthis(){ System.out.print("love the way you explain"); } public static void main(String args[]){ A obj=new A(); obj.printthis(); } }
@zombnie
@zombnie 5 жыл бұрын
very well explained.Thanks navin
@knowledgeunlimited
@knowledgeunlimited 5 жыл бұрын
The way you explain make things and concepts easy to understand. Thank you sir, good one
@TheFlyguy31
@TheFlyguy31 8 жыл бұрын
Thank you very much, Mr Reddy
@SmartProgramming
@SmartProgramming 5 жыл бұрын
its really awesome feeling to watch your tutorial, very very helpful tutorial 👌👌👌👌🙂🙂🙂
@THEGAMER-cc2eq
@THEGAMER-cc2eq Жыл бұрын
"My father's phone is my phone but my phone is not my father's phone" Father: Mera raja beta, aaja idhar tuze chocolate deta hu, aaja
@vinuthbt6647
@vinuthbt6647 3 жыл бұрын
Thank you so much ❤❤❤
@vigneshwarvicky5048
@vigneshwarvicky5048 5 жыл бұрын
nice example for method overriding with real time scenario
@vicky89ist
@vicky89ist 7 жыл бұрын
great teaching skill
@arvind_purushotham
@arvind_purushotham 3 жыл бұрын
father example..easy to remember for polymorphism, method overriding
@collinsushi1155
@collinsushi1155 7 жыл бұрын
To me, this video is centered on inheritance, method overloading and subclass overriding methods in superclass. You apparently said nothing on Polymorphism.
@SpiderpigThe
@SpiderpigThe 7 жыл бұрын
This is what Polymorphism is in Java, Method overloading is an example of static polymorphism, while method overriding is an example of dynamic polymorphism. The example he provided fits the best and the most important example in Java, which happens in parent to a child relation. Got finals tomorrow in Java lets see if he's right or not lol.
@collinsushi1155
@collinsushi1155 7 жыл бұрын
Whao!!! I apparently believe that; there is no polymorphism involved with overloaded methods (i.e methods with the same name but different arguments lists)
@siddharthadas86
@siddharthadas86 7 жыл бұрын
Absolutely. Polymorphism is with relation to method overriding. However when you override a method in a subclass, you can if the situation arises also overload it. The biggest advantage with polymorphisms is that behavior is defined in superclass but the nature of it depends on subclass type. So basically if two or more objects have the same instance variables but very different implementation of them in subclass, you put them inside an abstract superclass and then override those in your subclass as per your requirements. It saves lots and lots of extra coding. Abstract classes, polymorphisms/method overriding, Interfaces, inheritance and encapsulation is what OOP is all about
@eswarprasad9773
@eswarprasad9773 6 жыл бұрын
I agree with collins,coz in practical true polymorphism comes into picture when Upcasting and downcasting s done! yeah overloading and overriding are related to polymorphism,but he explained them with inheritance as center point viz a subclass using and changing its superclass s methods.
@Coolpratik10
@Coolpratik10 5 жыл бұрын
my phone is my phone none of your phone ,,, System.out.println("hello sir,nice lecture easy to understand ");
@_KIRUBHASANM
@_KIRUBHASANM Жыл бұрын
Sir can we have two classes which has same named methods but without inheritance?
@bogdanvasile5190
@bogdanvasile5190 8 жыл бұрын
Great trainer!
@Nishant_0073
@Nishant_0073 4 жыл бұрын
Sir,concept is cleared Thank You So Much Sir.......!!!!!!!!!
@sidramowlana
@sidramowlana 6 жыл бұрын
Understood perfectly thank you for the great explanation :)
@nirajpratimbhuyan76
@nirajpratimbhuyan76 5 жыл бұрын
Please let us know about Dynamic Polymorphism.
@ashutoshsharma5258
@ashutoshsharma5258 4 жыл бұрын
I was the one who was calling around 6:00. Sorry to disturb you all.
@shivamkamdi6822
@shivamkamdi6822 3 жыл бұрын
Thanks sir .!!!
@fareedahmedkhan9923
@fareedahmedkhan9923 3 жыл бұрын
Sir, what if we have got multiple methods with same name but different parameters in different classes Not in same classes Than what will be it called method Overloading or method overRiding
@chaitali2811
@chaitali2811 2 жыл бұрын
As per my knowledge, it will be called as method overloading because if we call the method from child class object, then it will return the result as per the parameters we are passing. It can return results from parent class too as per parameters passing.
@TonyBlundetto86
@TonyBlundetto86 5 жыл бұрын
Telusko is SO BOSS. I made my example with Animal as a superclass of Cat. As an animal, a cat breathes, eats, and shit. As a cat, meows, claws, and purrs. Overloading.- As an animal, eats(fish) and eats(meat).- Same method name, different parameter in the same class animal. Overriding.- Every animal shits everywhere they can normaly shit(where){everywhere}. A cat just shits in a sandbox. shit(where){sandbox}.- Same method in different class (Animal and Cat), shit(where) in child class cat overrides the shit(where) superclass Animal method, so our cat will be nice and shit in a sandbox as it should.
@muthusamyr4310
@muthusamyr4310 5 жыл бұрын
Ur example was awesome
@sulaimanabid5487
@sulaimanabid5487 4 жыл бұрын
He explained it very well highly recommended for java
@mechnovashia
@mechnovashia 7 жыл бұрын
Nice Explanation. I request you to make a video on Aggregation concept too.
@Chandalyt
@Chandalyt 4 жыл бұрын
Same example in python tutorial
@ankushbanerjee8509
@ankushbanerjee8509 3 жыл бұрын
Great Examples everyone can relate easily😍😍
@inji3570
@inji3570 5 жыл бұрын
Video voice quality is low, but your explanation is amazing
@smellydonut5088
@smellydonut5088 4 жыл бұрын
Thanks sm for this video! Definitely one of the best I've seen :)
@souravvibes001
@souravvibes001 6 жыл бұрын
I don't have any collection have lacture wise questions .so,If you sir free then make a video how to get i question.
@nesaresar7898
@nesaresar7898 10 ай бұрын
However, POLYMORPHISM in Java means that a superclass reference variable can reference objects of a subclass. Overriding in a "is - a" relationship (Inheritance) means that a method in the subclass overrides the method with the same signature in the superclass. Consider the following example: 1. public class ClassA 2. public class ClassB extends ClassA POLYMORPHISM means you can do the following code: ClassA obj = new ClassB ();
@swethabasani9707
@swethabasani9707 4 жыл бұрын
What r the java concepts we have to learn for selenium?
@yashbudhe97
@yashbudhe97 2 жыл бұрын
6:32 Epic Example😂
@SukruthJayam
@SukruthJayam 6 жыл бұрын
Super lecture
@SonOfDhanunjaiah
@SonOfDhanunjaiah 6 жыл бұрын
TQ very much
@Asingh42
@Asingh42 8 жыл бұрын
what is polymorphism I did not understand I just understand overriding and overloading
@laxminarayanpandey1191
@laxminarayanpandey1191 7 жыл бұрын
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object. if A is parent and B is child, then the reference of A should be able to refer the object of B: A ref=new B();
@sai5926
@sai5926 6 жыл бұрын
both overloading and overriding are called as polymorphism
@AmbarjeetChaudhari-u7j
@AmbarjeetChaudhari-u7j Жыл бұрын
Watching this video today...nice explain and clear concepts easily while you teach. btw- who is coming while you teaching sir ? 🤣
@fora1461
@fora1461 7 жыл бұрын
Superb!
@dopenope4829
@dopenope4829 4 жыл бұрын
i love it, when some things slip out of his mind and for remembering them he keeps looking at the roof XD . TBH great teacher
@raamch
@raamch 2 жыл бұрын
He portray like a beginner how he/she thinks so that it connects to beginners. That’s a great way of teaching a complex topic like Java programming.
@ahnipun
@ahnipun 7 жыл бұрын
thx for ur video
@nirmal2979
@nirmal2979 8 жыл бұрын
If your father's phone is your phone then is it not your phone is also your father's phone??? Is it inheritance???
@rohitsoni9325
@rohitsoni9325 8 жыл бұрын
Nope, Its Not inheritance, Inheritance is only one way concept; Eg: we have a class Engine; And If we want to have a Car, we will inherit Engine from the class Engine; Now, class Car have all the functions what class Engine had, This is Inheritance. ITS NOT LIKE :: If you inherit Engine for a class Car then class Engine will be having all the functions of car as well...
@bhautikmakwana9897
@bhautikmakwana9897 5 жыл бұрын
If diffrent name but same parameter in same class what is it call , Overriding??
@sauru265
@sauru265 5 жыл бұрын
No, it will be treated as new method. No method overloading and no overriding. For overriding, that method must exist in interface.
@rusty5100
@rusty5100 7 жыл бұрын
Great video. I laughed at your Hammer phone reference hahahahhahah
@HarshvardhanMishraPIER8
@HarshvardhanMishraPIER8 2 жыл бұрын
Why method overiding is called runtime polymorphism?
@Nextgentrick
@Nextgentrick 5 жыл бұрын
how does the word crush came in between
@sonalinarkar6087
@sonalinarkar6087 10 ай бұрын
Hello sir , do you still have live sessions to for questions and answers?
@gladiath0r
@gladiath0r 2 жыл бұрын
Disclaimer:No phones were harmed during this.
@nikhileshsahoo1789
@nikhileshsahoo1789 6 жыл бұрын
u havent told anything related to run time and compiltime polymorphism!
@yogeshpujari8172
@yogeshpujari8172 2 жыл бұрын
Types of polymorphism how to explain in interview
@swatidikonda955
@swatidikonda955 8 жыл бұрын
the lec was very nicely explained i want more lec on oops
@mohamadakkad4887
@mohamadakkad4887 7 жыл бұрын
deal with u
@alexcaesar5377
@alexcaesar5377 3 жыл бұрын
Accent is a big problem to comprehend the subject
@priyeshkaithvas3489
@priyeshkaithvas3489 Жыл бұрын
Best and easily explain this topic thankyou
@fareedahmedkhan9923
@fareedahmedkhan9923 3 жыл бұрын
Nice Explanation Sir, Literally got the whole concept and the examples also were superb Thank U 🤗
@jegadeeshjega296
@jegadeeshjega296 2 жыл бұрын
Good and super and explained well with example
@rustm5167
@rustm5167 5 жыл бұрын
thank u dude. like from me and subscribe (:
@geethamadhurivasa5779
@geethamadhurivasa5779 4 жыл бұрын
I think someone is disturbing u from your right side
@muhammadsaadamin6574
@muhammadsaadamin6574 7 жыл бұрын
sir you just have told overriding function but you havnt told which function will going to be run ie class A.show or classB.show kindly clearify in the reply below thnku v much !
@kevinpatel5106
@kevinpatel5106 4 жыл бұрын
That was a great analogy, thank you for your help!
@BeardAndBeans
@BeardAndBeans 4 жыл бұрын
java program that can maintain a list of items. It will display a menu with the functionality to add an item, and Display All Items (sorted in ascending order by price), and of course Exit.
@rajeshthakur-0163
@rajeshthakur-0163 5 жыл бұрын
System.out.println("hello sir,nice lecture easy to understand ")
@johnveslyalanroy1243
@johnveslyalanroy1243 4 жыл бұрын
error
@Leon_yt786
@Leon_yt786 5 жыл бұрын
Sir I have a doubt
@shijilnarayan3889
@shijilnarayan3889 2 ай бұрын
Amazing example sir !!
@nehamaggu3719
@nehamaggu3719 6 жыл бұрын
sir you hv not defined scenario when parent object is used to call methods and incase parent is not having function and parent object is used to call child method
@MJ-th2du
@MJ-th2du 8 жыл бұрын
it was great until the phone example :p , nice lecture very helpful
@Nisheemishra
@Nisheemishra 5 жыл бұрын
Hi Sir, Once i was asked give one example of a program which can have both overloading and overriding concept? Could you please help me on this
@alienpuppy
@alienpuppy 7 жыл бұрын
Actually polymorphism means many forms. Although i understand everthing in all of your videos, i still cant get the concept of polymorphism, and how are overriding and overloading related to it. thanks for your videos and greetings from south america.
@sreenu9482
@sreenu9482 5 жыл бұрын
sir please do videos on angular js or Video course for money in telusko.com
@raamch
@raamch 2 жыл бұрын
Never bored of your voice! #javatutorial outstanding Tutor.
@rosh9318
@rosh9318 3 жыл бұрын
poly " manny " morphism " forms "
@tahashaikh9958
@tahashaikh9958 7 жыл бұрын
Subscribed😎👍
@adityanjsg99
@adityanjsg99 4 жыл бұрын
Clear explanation. Budding Data Scientist, here for Java basics and more than happy.
@LukaszSkyWalker
@LukaszSkyWalker 6 жыл бұрын
Thx!!
@nikhileshm865
@nikhileshm865 4 жыл бұрын
Perfect exemplification
@vladanulardzic5859
@vladanulardzic5859 4 жыл бұрын
Great practical examples. So simply explanation of Polymorphism I have never seen before... and very effective. Thank you very, very much. Great teacher you are. Regards.
@juliet5446
@juliet5446 3 жыл бұрын
Best teacher I have come across
@nikhiljadhav6621
@nikhiljadhav6621 7 жыл бұрын
Is there any concept of Object Overriding ?
@dharanis9277
@dharanis9277 4 жыл бұрын
Nice explanation bro
@nishantsharma3100
@nishantsharma3100 4 жыл бұрын
bro you were uploading in 4k in 2016 . OMg lol
@nirmalapatra5985
@nirmalapatra5985 6 жыл бұрын
i heard about compile time polymorphism and runtime polymorphism. what is it then?
@yuvakiran1284
@yuvakiran1284 2 жыл бұрын
Excellent 👌👌👌👌👌👌
@arunjaiswal854
@arunjaiswal854 2 жыл бұрын
QnA sessions are going on?
@lisaswarn9838
@lisaswarn9838 4 жыл бұрын
does he still respond?
@abdelmalek9004
@abdelmalek9004 4 жыл бұрын
thank you very much,this is amazing, good explaining, the example of phone was is very impressive thank you again.
@nancharinaidualthi1047
@nancharinaidualthi1047 6 жыл бұрын
sorry to say voice is not clear sir... except that everything is good sir...
@vibecatcher4416
@vibecatcher4416 2 жыл бұрын
Thankyou sir
@aysha-8781
@aysha-8781 2 жыл бұрын
♥️ best lecture.
8.8 Polymorphism | OOPs | Method Overloading
4:13
Telusko
Рет қаралды 94 М.
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 107 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 57 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
html form attributes
2:55
Prasanna Srs
Рет қаралды 13
11.1 Object Cloning in Java Theory
4:47
Telusko
Рет қаралды 176 М.
8.20 What is Interface in java with example
8:00
Telusko
Рет қаралды 171 М.
#55 Polymorphism in Java
3:55
Telusko
Рет қаралды 136 М.
8.15 Anonymous Object in Java
12:53
Telusko
Рет қаралды 111 М.
Negative Time is Real, Physicists Confirm. Kind Of.
6:59
Sabine Hossenfelder
Рет қаралды 33 М.
8.1 What is Encapsulation in Java Tutorial
6:39
Telusko
Рет қаралды 393 М.
8.18 Abstract Class in Java Example
15:27
Telusko
Рет қаралды 383 М.
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 107 МЛН