Lesson-28 | Abstract Class | [OOP in Python]

preview_player
Показать описание
This is the lesson number 28 of the lesson series on Object Oriented Programming (OOP) in Python. It will be a complete course with the aim is to cover almost everything needed in Object Oriented Programming.

In this lesson we will discus about Abstract Class. An Abstract Class works as a template for other classes inherited from it.

Link to complete playlist:

Lesson Code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Review Questions of the Lesson*
1- Can we define Getter and Setter in Abstract Class?
2- When should we define a concrete method in an Abstract Class?

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

Sir your videos are great! This playlist was something that I have been looking for days. My sincere thanks for making this. I have successfully completed your playlist!:)
Ans: 2). When method overriding is necessary for child class we can have a concrete method in abstract class. Also, it can be used as a helper function to abstract methods.

jayasripalanisamy
Автор

Nice lecture as usual ..keep on uploading more...thank u

Astromoola
Автор

1- Yes, we can define Getters and Setters in Abstract class, as in some cases we need to get the values of some attributes through some functions.

maryumkainat
Автор

1)Yes!We can define setter and getter method inside abstract class.

hassanabdulbasit
Автор

2. We can use concrete method in an Abstract class if we have same logic and code for that method in both Abstract class and its Child classes.

ibtisamumer
Автор

1) Yes we can define getter and setter in Abstract class.
2)Yes we should define a concrete method when having same logic.

taimoorsikandar
Автор

1_Yes we can use setter and getter method in Abstract class.
2_ if all the child classes have same functionality, then we can define that in Abstract class under concrete method.
For example
Abstract class==> apple
Concrete method==> logo
As logo is same for every product, it can be a concrete method

shahrozahmed
Автор

1. Yes we could define getter and setter for Abstract class
2. We can define concrete method when child class has same logic and output

abdulrehmankhalid
Автор

1-Yes we can have a getter and setter method for the abstract class
2- A concrete method can be defined in the abstract class if we want a default method for all the child classes.

iqraamjad
Автор

2-Concreate(Normal) Method used by decorator @abstractclassmethod and import from abc.
concreate method call the abstract method used when same logic preferable with output.

ProphetPearls
Автор

1)yes, we can define both methods in Abstract class

ahteshamzafar
Автор

2019-MC-13
R_Q
1- Yes, we can define them in Abstract Class.
2- It is used when the child classes have the same logic.

dotienv
Автор

1- Yes! We can define getter setter in abstract class.

ridafatima
Автор

1) Yes, we can define them in Abstract Class.
2) It is used when the child classes have same logic.

dawoodimtiaz
Автор

2) yes we define the concrete method in the abstract class if child class have same logic or metod used

wk
Автор

1- Yes, getter and setter methods can be defined for abstract class
2- This should be done when child classes have same logic

muhammadalihaider
Автор

Rev-1
Yes, Getter and Setter methods can be defined in abstract class.
Rev-2
When there is a common method in all child classes.

AliHamza-zwvt
Автор

2. Concret method will be used when child classes follow the same logic .. at that time concret method would be defined in abstract class

syedfarazabbas
Автор

1) we can define setter and getter method for abstract class
2: It's useful when child classes have same logic.

talhakamboh
Автор

when we wanna use some methods of abstract class that are also useable in other classes that inherit from abstract class we should define a concrete method

MuhammadAbdullah-vwsg