Thank you for the explanation. When parent class reference refers to the child class object then, which method will be called method of the child class or method of parent class?
Hi Mukesh, thanks for the video! Could you please post a video explaining the scope of "default" and "protected" access modifiers and real time implementation?
Hello Mukesh, One question related to interface seeing the video when you compared overriding with implementation, can we just left the methods declaration as is and not write the body in the method which is getting override/implementing case of implementing an interface? How should it work? Thanks in advance :)
Hi Akash, if you dont write anything inside the method (while implementing) then it wont make any sense. Even if you have no statement it will be method with no output.
Hii Mukesh...great explaination...but have one doubt... In case of Inheritance: Parentclass obj= new childclass() then...we are able to get parentclass methods. but in case of method overriding: Parentclass obj= new childclass() we are able to get child class methods. Is it correct??????
Hi Monali, in this case Parentclass obj= new childclass() both parent class and child class has same method so child class method will get called because it is overriding feature.
so in overloading, we define a method with the same name but the signature is required and in overriding, we define the same name method but signature is not must??
Thank you for the explanation.
When parent class reference refers to the child class object
then, which method will be called method of the child class or method of parent class?
Parent class
@@Mukeshotwani Thanks for your reply. So here, the parent class methods and overridden methods of child class(if any) will be called. Am I right?
Hi Ajeesha I have discussed all possible scenarios here ua-cam.com/video/6Er5pIEiscI/v-deo.html
Child method will be called
Perfect explanation, thanks for sharing it.
Thank you Naveen
Your videos are simple and easy to understand
Glad you like them! Thanks Venu
Great Thanks Mukesh for your efforts to make us understand easily..
Hi Mukesh, thanks for the video!
Could you please post a video explaining the scope of "default" and "protected" access modifiers and real time implementation?
Yes Imran will post soon.
it will be even more helpful if you show us some real life example in selenium . appreciate your work.
Sure mate will do.
Thank you sir .
Hello Mukesh,
One question related to interface seeing the video when you compared overriding with implementation, can we just left the methods declaration as is and not write the body in the method which is getting override/implementing case of implementing an interface?
How should it work? Thanks in advance :)
Hi Akash,
if you dont write anything inside the method (while implementing) then it wont make any sense. Even if you have no statement it will be method with no output.
Hii Mukesh...great explaination...but have one doubt...
In case of Inheritance:
Parentclass obj= new childclass()
then...we are able to get parentclass methods.
but in case of method overriding:
Parentclass obj= new childclass()
we are able to get child class methods.
Is it correct??????
Hi Monali, in this case Parentclass obj= new childclass()
both parent class and child class has same method so child class method will get called because it is overriding feature.
In dynamic binding we can use super keyword to call parent class method?
Hey Sameer yes if parent and child class has same method then super.method() can be used.
😊👍👍
Hi,
when I am implementing the methods of interface, I am also getting the @Override annotation also. Do I need to remove the annotations?
Its not mandatory gaurav, you can either keep or remove.
so in overloading, we define a method with the same name but the signature is required and in overriding, we define the same name method but signature is not must??
But what to answer when interviewer ask that why runtime polymorphism decide to overiding why overiding is decided fot runtime polymorphism
Hi RB, because method behavior changes depends on object or reference.
Hi Mukesh, What kind of guidance I will get if I join your you Tube channel by paying amount 159, please guide me.
Hey Sonam, it is just a support program. Its completely optional.
Thank you Sir