This video is a little vague, so let me try to explain this in a more simple manner. Consider a program that deals with shapes drawn on the screen. Let's say that the shapes include rectangles, ovals, and roundrects of various colors. Three classes, Rectangle, Oval, and Roundrect, could be used to represent the three types of shapes. The three classes would have a common superclass, *Shape*, to represent features that all three shapes have in common. The Shape class could include instance variables to represent the color, position, and size of a shape, and it could include instance methods for changing the values of those properties. Now, if you think about it, there can never be any reason to construct an object of type Shape! We say that Shape is an abstract class. An abstract class is one that is not used to construct objects, but only as a basis for making subclasses. An abstract class exists only to express the common properties of all its subclasses. If you still don't get it, the same would apply for a class Vehicle. There is no way to 'own' a vehicle as such. You can't go up to a friend and ask: "What car do you have?", and he would respond with: "I got a vehicle man!!", there's just no way. Therefore Vehicle would be an example of an abstract class. The actual vehicle has to be a car or a truck or a motorcycle of a specific brand with a specific color, or some other "concrete" type of vehicle. I hope you guys get it now :)
from what i understood, it was used to update the methods, because sometimes large projects cant finish it in a short period of time, to avoid going back at the top, abstract is used to continue unfinished methods. Abstract methods are undefined actions/methods. concrete method is the finished actions/methods.
wow, wt a explanation about abstract. thank you so much sir . you always gives real life example and makes me not to go back and revise . one time watch of tutorial is enough to understand. thank you so much clear my concept
Hello Sir, Thanks for your amazing tutorial I didn't quite get the part we create the Show method, I assume we can directly call the showConfig() from each class, why do we nedd the last method?
thanx for explaining this. this is a awesome video. can u pls tell me what are the topics require to know in java to undergo an android development training?
can you please make a complete java project that has all the concepts of java in Eclipse? like a program that uses all the java features (or at least the important ones) in one series of videos? or a complete series of making a andriod app ?
But I heard somewhere that we can't create objects of abstract class, and in method show(phone obj) we are passing object of an abstract class. How. ???
SureshPhone obj=new SureshPhone(); also gives the same output. Question: Q1. Is it fine to do it in above mentioned way?? Q2. If Q1 answer is no then why? Q3. if Q1 answer is yes then in which situation we need to use: ParentClass obj=new ChildClass();
hello sir .nice video ..but pls give some example related to small mathematical formule like add n subtract...this phone example is little bit confusing ....I did not understand the use , the need of abstract class actuLly
What if I have two methods under each subclass and I want to call the methods alternatively eg: i have call and text methods and the output must be calling...(1st subclass) calling...(2nd subclass) texting...(1st subclass) texting...(2nd subclass)
in our example of phone .in public static void main.. after creating of object of iphone and samsung u had written show(obj or obj1).WHAT IS USE OF WRITTIMG THIS show() plz explane
Wonderful Teacher ..... I have a question sir? For which class you r creating object sir? @9:23 MaheshPhone obj = new SureshPhone(); I am little bit confused on the above step sir?... please help me sir......
Sir , We can do same thing by overriding the showConfig() of Parent class "Phone" in both class Iphone and SamsungS4 and then use reference of parent class (Phone) in object passing as a parameter.......now my question is If we can do this by Overriding then how abstract class is more efficient ???? Whats the difference in between both the programs??? (Pls Ignore Grammar ,I know google is also unable to auto correct this.....lol)
In your second example you have written the method as : public static void show(phone obj) this confuses me as in I don't understand how are the objects getting passed to get the desired result because you are modifying as either show.(obj) or show.(obj1) but in public static void show(phone obj) you are not modifying it as obj or obj1 so how does the differentiate its working?
Great video. My doubt is why we we made the show() method static? I know it gave an error(Non-static method cannot be referenced from a static context) but I am not getting its concept.
static methods can call non static methods of other class...if one only if we have reference of that other class...in the above video, he had accessed the other class method by using reference of that other class.. so he didn't got any error.
two things to understand while extending an abstract class 1) if you extend an abstract class and override or implement all the methods in it,then there is no need of using keyword abstract. 2)if there are 2 abstract method and you override only one,then it is compulsory to use abstract keyword. In the example explained above,Abstract class Phone has only one abstract method which he has overridden in child class,hence there is no error and also object of that class can be created.
Hi naveen , What is the correct way of writing classes?you have written all above classes inside same ad demo.java thing. eg class Addemo,iphone and samsung s4. So what if we create classes seperately?Is it a time wasting thing? I am a beginner.
sir , in this lecture you told that an abstract class can have abstract method or not . But can you give me one example of a abstract class which don't have any abstract method?
bro if we could define concrete methods also in abstract class then what is the use of abstract class ,we could define that concrete method in a concrete class
It's 2019. Still phone can't move, dance or cook :(
Abstract phones
its 2021 and they still cant do, what done by ramesh in 5 min
@@alisarwar3399 😂
Now it's 2022 I can make my phone move and dance by my own
Now it's 2022🥲 sadly we got no such phones yet
This video is a little vague, so let me try to explain this in a more simple manner. Consider a program that deals with shapes drawn on the screen. Let's say that the shapes include rectangles, ovals, and roundrects of various colors. Three classes, Rectangle, Oval, and Roundrect, could be used to represent the three types of shapes. The three classes would have a common superclass, *Shape*, to represent features that all three shapes have in common. The Shape class could include instance variables to represent the color, position, and size of a shape, and it could include instance methods for changing the values of those properties. Now, if you think about it, there can never be any reason to construct an object of type Shape! We say that Shape is an abstract class. An abstract class is one that is not used to construct objects, but only as a basis for making subclasses. An abstract class exists only to express the common properties of all its subclasses.
If you still don't get it, the same would apply for a class Vehicle. There is no way to 'own' a vehicle as such. You can't go up to a friend and ask: "What car do you have?", and he would respond with: "I got a vehicle man!!", there's just no way. Therefore Vehicle would be an example of an abstract class. The actual vehicle has to be a car or a truck or a motorcycle of a specific brand with a specific color, or some other "concrete" type of vehicle.
I hope you guys get it now :)
Thanks you made that much simpler
Thanks mate for this simple explanation.
great, appreciate your sharing :D
Nice
vehicle and car example look like more Enum class not abstract class
90 minutes of lecture explained in 15 minutes thank you!!
from what i understood, it was used to update the methods, because sometimes large projects cant finish it in a short period of time, to avoid going back at the top, abstract is used to continue unfinished methods.
Abstract methods are undefined actions/methods.
concrete method is the finished actions/methods.
You have explained the concept of "Abstract Class" brilliantly in this video.
Kohli of Java. Waiting for ur tutorial daily. Daily learning a concept helping me a lot. Thanks sir.
Hah Sir..please keep it up
It's 2021 and we're still searching from someone like Suresh. :')
The best example of Abstraction i have ever seen!
wow, this was such a good explanation, my professors never took the time to explain these topics this well, thank you!
What a wonderful explanation ! The actual concept of Abstract class is now cleared with the help of your video. Thanks a lot again Navin Sir !!
Another method should be ====> private void paymytaxes(); I am sure everyone would love that feature.
completely understood " abstract class cannot be instantiated(cannot have objects) but can be inherited by other classes "
thanks for the explanation sir, thank you thank you 👍👍👍🙂🙂🙂🙂
preparation for semesters exams from your video's 🔥🔥
Best video lectures on java.... Sounds Good!!!!
Hi, I'm software engineering student and this fella is brilliant in explaining.
Best way of teaching really understood the concept after watching only once. Really insprirng way
very good examples that making me easy to learn.. big thank u...
Sir i am so facinated by ur explanations on java topics well explaind and brief execution .good sir keep it up and we are waiting for ur classes
No words Navin, awesome 👏👏👏👏👏👏👏
Hello Navin, you are a great teacher. Thank you.
Thanks for the simplified understanding
wonderful explanation of abstract class!!
Awesome again . you are best at your work. you should be appreciated for your wonderful work....
Finally! Thank you! I really needed an example that made sense. Great video :)
It's a really great introduction of abstract class! Thank you!
Awesome Explanation, Very Nice
Thanks for giving proper example.
wow, wt a explanation about abstract. thank you so much sir . you always gives real life example and makes me not to go back and revise . one time watch of tutorial is enough to understand.
thank you so much clear my concept
excellent bro. you save my days.i was learning interface so it's required to know the knowledge of abstract method and class.
Thanks! It really helped me to understand what my college professor didn't teach well.
2 day of dozen doubt explained in 1 short vedio... Wow thank u ❤️❤️👏
Excellent explanation
fantistic bro!!!! i cleared totally!!!! thanks a lot!!!
Superb
Explanation
Well done ! Keep on ...
Nice video i got how abstraction works
Your explanation is outstanding i am looking for a video like this .Thank u sir.
You did a great job!
you are an absolute God
excellent explanation thanks
Hello Sir, Thanks for your amazing tutorial
I didn't quite get the part we create the Show method, I assume we can directly call the showConfig() from each class, why do we nedd the last method?
Yeah...that is also one way
great example
Thankkkkkkk you so much sir for given this super explanation |
u r amazing sir , thanku for such wonderful explanation
It's 2022 now still phone can't dance
Ek tarfa sir
Nice explanation
thanx for explaining this. this is a awesome video. can u pls tell me what are the topics require to know in java to undergo an android development training?
Very useful nd clr.tq
Thanks for your teaching. Can you continue this for creating normal class inside abstract class?
can you please make a complete java project that has all the concepts of java in Eclipse? like a program that uses all the java features (or at least the important ones) in one series of videos? or a complete series of making a andriod app ?
i have to thank you mr. Telusko for this video
i want to ask you about if you have any code for complex number abstract class
Thank you again
hi Sir can you please make a video on diffrence between abstraction and interface.?
Ausum explanation sir..........
But I heard somewhere that we can't create objects of abstract class, and in method show(phone obj) we are passing object of an abstract class. How. ???
thats just a reference. Not actual Object
SureshPhone obj=new SureshPhone();
also gives the same output.
Question:
Q1. Is it fine to do it in above mentioned way??
Q2. If Q1 answer is no then why?
Q3. if Q1 answer is yes then in which situation we need to use:
ParentClass obj=new ChildClass();
Q1.yes
Q3.Dynamic Method Dispatch
This is basically polymorphism , up casting.
Every college teacher play gangsta until Telusko come in.
Excellent..
hello sir .nice video ..but pls give some example related to small mathematical formule like add n subtract...this phone example is little bit confusing ....I did not understand the use , the need of abstract class actuLly
Thank you so much ❣️
A lot of thank you sirG.
super explanation
Thank you so much guruji😃
Very good video! - But why would someone need an abstract class in his java life?
LOL,i think u need to loop the video to understand it
Nithin Spicy so funny 😂
thanks for the video :)
What if I have two methods under each subclass and I want to call the methods alternatively
eg: i have call and text methods
and the output must be
calling...(1st subclass)
calling...(2nd subclass)
texting...(1st subclass)
texting...(2nd subclass)
Great
awesome
in our example of phone .in public static void main.. after creating of object of iphone and samsung u had written show(obj or obj1).WHAT IS USE OF WRITTIMG THIS show()
plz explane
I think the use of it is to call the method show()
Thank you!!
Thanks sir
Nice video
Sir can you explain this code. Why did you use ' static show(Phone obj) method ? And why did you use show(obj) ;
Sir, in second phone example, why you pass the obj in show method. In main method obj. Showconfig() ; to we directly get the answer. Then why?
In 8.18 2nd example is not much cleared.
Thanks
Good
Wonderful Teacher .....
I have a question sir?
For which class you r creating object sir? @9:23
MaheshPhone obj = new SureshPhone();
I am little bit confused on the above step sir?...
please help me sir......
Why we are using a separate method canned public static void show, why can't we call showconfig from main class??
The abstract classes cannot be instantiated even if they contain concrete Classes??
like you are teaching to your self
is it practicing or teaching
Cook and Dance for a phone sounds bizarre even as an example! Could have used something else like Vibrate and 3G/4G. Good concept explanation.
It makes sense to me
Sir , We can do same thing by overriding the showConfig() of Parent class "Phone" in both class Iphone and SamsungS4 and then use reference of parent class (Phone) in object passing as a parameter.......now my question is If we can do this by Overriding then how abstract class is more efficient ???? Whats the difference in between both the programs??? (Pls Ignore Grammar ,I know google is also unable to auto correct this.....lol)
In your second example you have written the method as : public static void show(phone obj) this confuses me as in I don't understand how are the objects getting passed to get the desired result because you are modifying as either show.(obj) or show.(obj1) but in public static void show(phone obj) you are not modifying it as obj or obj1 so how does the differentiate its working?
Great video. My doubt is why we we made the show() method static? I know it gave an error(Non-static method cannot be referenced from a static context) but I am not getting its concept.
static methods can call non static methods of other class...if one only if we have reference of that other class...in the above video, he had accessed the other class method by using reference of that other class.. so he didn't got any error.
Sir, you wrote
MaheshPhone obj = new SureshPhone();
Why did that not give any error or warning?
because Grandson can inherit features from grandfather or not
At 14:10 , how did you extend abstract class(Phone) without without using abstract ?
two things to understand while extending an abstract class
1) if you extend an abstract class and override or implement all the methods in it,then there is no need of using keyword abstract.
2)if there are 2 abstract method and you override only one,then it is compulsory to use abstract keyword.
In the example explained above,Abstract class Phone has only one abstract method which he has overridden in child class,hence there is no error and also object of that class can be created.
4:21 is this a compilation or syntax error?
OMG, it is so easy to understand. :D
Mind blown !
Hi naveen ,
What is the correct way of writing classes?you have written all above classes inside same ad demo.java thing. eg class Addemo,iphone and samsung s4. So what if we create classes seperately?Is it a time wasting thing? I am a beginner.
whats the use of normal methods in abstract class if its not static
sir , in this lecture you told that an abstract class can have abstract method or not . But can you give me one example of a abstract class which don't have any abstract method?
is it possible to initialize value in constructor in abstract class?
No
Soo ,if we create an abstract method , then it will surely get overridden? (By some different class)
bro if we could define concrete methods also in abstract class then what is the use of abstract class ,we could define that concrete method in a concrete class
Sir, if abstract class doesn't able to create object then how can it being passed object of phone from method show .
Sir
By using parent refrence we can create child object but by using that object we can only call parent method
But here you call all the method