What is abstraction :
- Abstraction means hiding implementation details and showing only essential features to the user.
How to achieve abstraction :
- Using abstract keyword
Where you used abstract keyword :
- We can use abstract keyword in class level and method level.
Can an abstract class have:
Constructors? ✅
Private methods? ✅
Static methods? ✅
Final methods? ✅
Answer : Yes
Notes :
abstract class does not have method definition.
We can't create object directly.
Can we create an object of an abstract class?
- Answer: ❌ No But reference can be created
BankService service = new UPIService();
Can an abstract class have instance variable ?
Answer : Yes
Top comments (0)