Difference between abstract class and interfaceAbstract class and interface both are used to achieve abstraction where we can declare the abstract methods. Abstract class and interface both can't be instantiated. But there are many differences between abstract class and interface that are given below.
Simply, abstract class achieves partial abstraction (0 to 100%) whereas interface achieves fully abstraction (100%). Example of abstract class and interface in JavaLet's see a simple example where we are using interface and abstract class both. Test it NowOutput: I am a I am b I am c I am d Next TopicPackage in Java |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India