What is Abstraction in java?
Abstraction is a technique of hiding the internal detail and showing only the essential data to the user.
We can achieve Abstraction by using two ways
By using Abstract class :
By using abstract class we can achieve 0 to 100% abstraction . It provides as partial abstraction in abstract class we can create abstract method as well as concrete method that’s why it does not provide 100% abstraction.
By using Interface
By using interface we can achieve 100% abstraction because it only contain abstract method inside interface. And from java 8V we can also write default method inside interface.
Example : for example Keyboard in keyboard when we press space key then we get one space but user don’t know what mechanism is happening inside the key they hide the internal detail or work only shows the essential details is known as abstraction in java.