Concept of Abstraction
Abstraction is one of the concept of Object Oriented Programming.
In simple terms Abstraction means showing only functionality to user and hiding internal details.End user will not come to know how a particular functionality is implemented .Concentrate on how to use a function rather to think how function is coded.
How to achieve Abstraction ?
Abstraction can be achieved in following two ways:
In simple terms Abstraction means showing only functionality to user and hiding internal details.End user will not come to know how a particular functionality is implemented .Concentrate on how to use a function rather to think how function is coded.
How to achieve Abstraction ?
Abstraction can be achieved in following two ways:
- Abstract Class
- Interfaces
- Abstract class is a class which is declared with keyword Abstract and this can not be instantiated.
- Can have abstract or non abstract methods
- Abstract class achieves 0 to 100% abstraction.
- Interface is a class which is declared with keyword Interface and has only abstract methods.
- Interface is a contract /rules /blue print of a class
- Interface achieves 100% abstraction.
0