Abstraction is the process of hiding the implementation details and showing the required functionality to the user.
In Java abstraction is achieved through abstract classes and interfaces.
Some Features of abstract classes.
- In abstract class there are both abstract and non abstract methods.
- These classes cannot be instantiated.
- These classes uses abstract keyword in order to declare a class as abstract.
- Abstract classes also uses extend keyword like normal classes.
Some features of Interfaces.
- All the methods in interface are by default abstract, you don’t have to declare it as abstract.
- Methods in interfaces are implicitly public.
- For extending an interface we have to use implements keyword.
- We can extend many interfaces using “implements” keyword however, we can only extend one class.
For your further understanding I have also added a video .
Feel free to comment and subscribe.