How to achieve abstraction?
Q. How to achieve abstraction ?
Ans :- we can achieve abstraction by using abstract classes and Interfaces.
Abstraction in java can be achieved in two ways:
Using abstract classes:- Abstract classes achieve partial abstraction as concrete methods can also be defined in them.
Using Interfaces :- Interfaces achieve complete abstraction as only abstract methods can be defined in them.
Comments
Post a Comment