8.18 Abstract Class in Java Example

preview_player
Показать описание
An abstract class is an incomplete class. An abstract class is defined with the
keyword abstract . We cannot create an object of the abstract class because it is
not complete.

These classes cannot be instantiated and are either partially implemented or not at all
implemented.
This class contains one or more abstract methods which are simply method
declarations without a body.
This class is used when common features are shared by all object.

Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Editing Monitors :

Editing Laptop :

Mics

Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Рекомендации по теме
Комментарии
Автор

It's 2019. Still phone can't move, dance or cook :(

marvel
Автор

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 :)

notbarbara
Автор

90 minutes of lecture explained in 15 minutes thank you!!

govegan
Автор

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.

duyejamilla
Автор

Kohli of Java. Waiting for ur tutorial daily. Daily learning a concept helping me a lot. Thanks sir.

kotiramamurthydavuluri
Автор

You have explained the concept of "Abstract Class" brilliantly in this video.

RiteshKumar-rixq
Автор

It's 2021 and we're still searching from someone like Suresh. :')

rajbhardwaj
Автор

wow, this was such a good explanation, my professors never took the time to explain these topics this well, thank you!

skiinet_
Автор

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 !!

muleytanushri
Автор

The best example of Abstraction i have ever seen!

AbdulWasaeTariq
Автор

preparation for semesters exams from your video's 🔥🔥

harishkumarforever
Автор

completely understood " abstract class cannot be instantiated(cannot have objects) but can be inherited by other classes "

isloo_boy
Автор

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

albinvarghese
Автор

Finally! Thank you! I really needed an example that made sense. Great video :)

judonomi
Автор

Best way of teaching really understood the concept after watching only once. Really insprirng way

vijayjangid
Автор

Hi, I'm software engineering student and this fella is brilliant in explaining.

rajakhan
Автор

Best video lectures on java.... Sounds Good!!!!

pradyumna
Автор

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. ???

rishabhsingh
Автор

thanks for the explanation sir, thank you thank you 👍👍👍🙂🙂🙂🙂

SmartProgramming
Автор

It's a really great introduction of abstract class! Thank you!

henry