I really appreciate it! it's the best lecture I've ever seen of upcasting & down casting. I had hard time to understand of that. but I got it completely thanks to your thorough explanations! thanks again!!!👍👍👍👍🌹🌹🌹
On 31:00 you were upcasting "s" to "Object" type but class "Mobile" didn't extend the Object class. If I create the method "calling" in the Object class but without inheritance will it work. OR is inheritance important for upcasting and downcasting?
Hi @ameek Khan, The object class is the base class for each and every java class. Hence, even if we do not explicitly extend the object class, in any of the classes that we create, it by default internally extends the object class internally.
Thanks @seleniumExpress for such in detailed explanation. Can you please provide similar video for the downcasting stuff. Am sure people following your channel would be eager to watch that.
sir, this video is now more clearer than any video..great work..do more videos and make videos on down casting,string and sorting as early as possible...
Oh my gosh!!! Your lecture is really really helpful? I like the way to keep repeating your explanation until it goes to the mind. !!!! Thank you so much following you from Seattle !! Amazon hope you will be in touch
Hey Abhilash, I have a doubt while going through an example based on this. class A{ int i=10; } class B extends A{ int i=20; } class Main { public static void main(String[] args) { A a = new B(); syatem.out.println(a.i) }
} When I am compiling this , i am getting output as 10....but as per your video, the child class overrides the parent class methods, as we are assing the object of B in ref of A
class A{ public void a(){ int i=10; System.out.println(+i); } } class B extends A{ public void a(){ int i=20; System.out.println(+i); } } class Example2 { public static void main(String[] args) { A a = new B(); a.a(); }
} just override method if you want your output as 20......
Class Demo1 { Public void display() { System.out.println("hi"); } } Class Demo2 extends Demo1 { Public void display() { System.out.println("bye"); } } Class Mainclass10 { Public static void main(String[] args) { Demo1 d1=new Demo2(); d1.display();//up casting } } Explain :why out put is Bye, In upcasting concept parent properties should display
Hi Deepthi, It is so because in method overriding... for instance methods which overridden method is called depends upon the type of object which is being called and not upon the type of reference.
Hi Deepti, Here by using parent class reference creating an object to the subclass. With this reference if we call any method which is available in the parent class, then at the time of run time JVM checks whether this method has been overridden in it's child class or not. If this calling method has been overridden, then it print overridden method's output (from child class method). Otherwise it prints parent class method data. In your example, the method has been overridden in the child class, that's why you got child class method output.
Crox what do you mean!! Your declaring a reference variable(obj) pointed to the class A . The obj will go looking for the constructor if it’s defined will implement it or it will run the default constructor behind the scene
Hi, I am unable to find the link for downcasting in Java, I have watched upcasting videos, it was very nice.Please provide the link for Downcasting tutorial.
Hello sir I have a question that I got in my exam. So say Bite b=new Drink() ; here Bite is super class and Drink is child class. In exam the question was what will be answer of b. Method2() which is not present in both the classes mentioned above but this method2() is present in parent class of Bite class. So what will be the answer to this. Thank you
You have a gift. I know this is 6 years old, I hope you have since continued on and found a way to impact even more people with your teaching talents.
This is best ever video of typecasting in youtube...thank you so much sir...
Thank you so much 😀 all my doubts got clear. This is best ever video of typecasting in TH-cam...👏
36:17 --> Key sentence of the whole talk imho
Best video ever on Upcasting! + Description is lit Thank you, sir!
Thanx fir this video...Finally I got clear idea about upcasting ...Thnx a lot
What a clear cut video very very well understand very good work bro
Wow easily understands one of the critical topics. Thanks for your effort Bro.
This is what I needed... Explanation to the point... Great bro
very Nice...Need ur downcasting video
Finally i understood this java puzzle ! Thanks a lot !!
What a explanation!!!all basics are cleared.
Awesome explaination now I got full clarity on concept..I can visualize things now
Your explanation was very sttraight forward and logical at the same time
your video make me understand the concept of upcasting >THANK YOU SO MUCH
Thank you so much !!! 👏 God bless you!
Thank you so much 😀 almost all doubts got clear👏 God bless you!
I really appreciate it! it's the best lecture I've ever seen of upcasting & down casting. I had hard time to understand of that. but I got it completely thanks to your thorough explanations! thanks again!!!👍👍👍👍🌹🌹🌹
Thanks a lot Sir ji.. appreciate your efforts! 🇮🇳🙏🌈
Explanation is very nice on Upcasting, Please upload video on Downcasting also.
Very useful class, thanks a lot
Excellent Video
Hi Abhilash pls upload more videos.It is very resourceful.We could knew how it works in real time environment
Super Amazing Excellent Explanation I have no enough word to express thanks
Up Casting video is ultimate and well explained. Could you please provide down casting video too ?
love you brother . you did underrstand me well ................
well explained thanks a lot for making easy to understand
Awesome examples
Thank you.. ULTIMATE Lectures...keep it up
Vikas Chaurpagar thanks, Vikas.
On 31:00 you were upcasting "s" to "Object" type but class "Mobile" didn't extend the Object class. If I create the method "calling" in the Object class but without inheritance will it work. OR is inheritance important for upcasting and downcasting?
Hi @ameek Khan, The object class is the base class for each and every java class. Hence, even if we do not explicitly extend the object class, in any of the classes that we create, it by default internally extends the object class internally.
@@KG-vo6rg Thanks for the clarification.
Really It was nice explanation
MAN! , you are truly great.
Thanks @seleniumExpress for such in detailed explanation. Can you please provide similar video for the downcasting stuff. Am sure people following your channel would be eager to watch that.
Well explained!!! Is the video on downcasting uploaded?? If yes can u please share the link??
outstanding brother
Outstanding lecture 🤗
Next durgasoft is here
Super explaintion sir nailed it👌👌
Please tell me the downcast video link.
Nice explanation
awesome bro, u elucidated it in outstanding manner.
excellently explained.thanks
sir, this video is now more clearer than any video..great work..do more videos and make videos on down casting,string and sorting as early as possible...
Thanks, Ajit. Happy to know that it helped you.
Excellent explanation sir !!!!!!
Thx for clearing doubt
awesome.. explained it really well..
Nice explanation bro...u are giving more examples for better understanding. I like the way Ur explanation
marvellous sir.., could u pls upload downcasting.. it will very helpful..
Smart explanation with a simple example... taking greater effort to explain that should be understood by the viewers... kudos to you
awesome video...waiting for down casting video :-)
Sure Dilip. It will be published by the next week.
I cant see the down casting video. Please give the link.
Please upload down casting video.
this video was great.. and clearly I got the idea why overriden methods are called run time polymorphism.. pease upload 2nd and 3rd video also...
nice work
Your classes are good please provide PDF notes for the videos.then it is easy to understand
Awesome Explanation bro....!!
more informative, thanks
I am very clear the casting concept now.Thanks alot..Please do more videos u have very good future..:)
Thanks, Teju Sree. I am glad to know that you found it helpful.
Excellent.. keep it up.
great lecture man! clear and comprehensive
good lecture
Tq so much🤗
Awesome explanation ...Thanks a lot.
Very very useful bro... please update downcasting video also
great video..keep up the good work !!
love your explanations alot. Great job!
Hi, nice explanation. Can you please upload downcasting as well. !
Nice explanation..
Thanx..
Oh my gosh!!! Your lecture is really really helpful? I like the way to keep repeating your explanation until it goes to the mind. !!!! Thank you so much following you from Seattle !! Amazon hope you will be in touch
Thanks lot Abhilash ,,waiting for Downcasting
Abhilash upcasting=(Java)a; :D :D
Sure, Akula... It's going to take a while as I am busy with making some progress with spring tutorials these days.
Thanks for watching 👍
just awesome
Explain is excellent,
Please write the link of that you teach downcasting
Best video, where is the downcasting video❤
Awesome awesome
Please make video on How these things works for method overloading..
very helpful!
Well done bro, love from Odisha, Waiting for more videos.
High five 🙏 I am from Odisha too ☺
Nice explaination!!
Please use one plus as example 😃
Thanks a lot
Hi , i think for this concept 50ms is too much , Please make it short and your explanation very good .....
Can you clarify what is that we cannot achieve using normal object, so we use upcasted object.
Hey Abhilash, I have a doubt while going through an example based on this.
class A{
int i=10;
}
class B extends A{
int i=20;
}
class Main {
public static void main(String[] args) {
A a = new B();
syatem.out.println(a.i)
}
}
When I am compiling this , i am getting output as 10....but as per your video, the child class overrides the parent class methods,
as we are assing the object of B in ref of A
class A{
public void a(){
int i=10;
System.out.println(+i);
}
}
class B extends A{
public void a(){
int i=20;
System.out.println(+i);
}
}
class Example2 {
public static void main(String[] args) {
A a = new B();
a.a();
}
}
just override method if you want your output as 20......
In JAVA,we can override methods,variable can't be overriden!!
Perfect ! Keep on ...
good one.Kindly share the down casting link as well
Class Demo1
{
Public void display()
{
System.out.println("hi");
}
}
Class Demo2 extends Demo1
{
Public void display()
{
System.out.println("bye");
}
}
Class Mainclass10
{
Public static void main(String[] args)
{
Demo1 d1=new Demo2();
d1.display();//up casting
}
}
Explain :why out put is Bye,
In upcasting concept parent properties should display
Hi Deepthi,
It is so because in method overriding... for instance methods which overridden method is called depends upon the type of object which is being called and not upon the type of reference.
Hi Deepti,
Here by using parent class reference creating an object to the subclass.
With this reference if we call any method which is available in the parent class, then at the time of run time JVM checks whether this method has been overridden in it's child class or not. If this calling method has been overridden, then it print overridden method's output (from child class method). Otherwise it prints parent class method data.
In your example, the method has been overridden in the child class, that's why you got child class method output.
Good one.
Thanks, Praveen.
Thanks dear
sir I want to that you share another video about down casting like similar to this video ?
Nice explanation sir......keep doing 😊
Thanks, Sid.
good
Bhai can you please prepare a video on singleton design pattern and how can we prevent it from breaching.
a obj = new a();
What does a() constructor actually do ? please explain more deeply . It's confusing
Crox what do you mean!! Your declaring a reference variable(obj) pointed to the class A
. The obj will go looking for the constructor if it’s defined will implement it or it will run the default constructor behind the scene
Now i finally understand ...thanks for helping out
where is the link of downcasting video, can u pleas provide
Bro make selenium interview questions and answer ...
u can also state a API series
Hi,
I am unable to find the link for downcasting in Java, I have watched upcasting videos, it was very nice.Please provide the link for Downcasting tutorial.
i subscribed your channel.
thank you
When you will upload downcasting video
This video is very useful but unable to find downcasting video.could you please help with the link of that?
Link for Downcasting ??? Please
amaaaaaaaaaaaaaaaaaazing
right right right!!!!!
I can't find out video for downcasting ? is it there ?
Hi, where is down casting?
Hello sir I have a question that I got in my exam. So say Bite b=new Drink() ; here Bite is super class and Drink is child class. In exam the question was what will be answer of b. Method2() which is not present in both the classes mentioned above but this method2() is present in parent class of Bite class. So what will be the answer to this. Thank you
there won't have error.