What is the difference between abstract class & Interface.

What is the difference between abstract class & Interface.

Both Abstract class and interface can\'t be instantiated. 

Abstract class may have abstract and non-abstract methods. 

Interface may contain only abstract methods.

 Abstract class doesn\'t support multiple inheritance.Interface supports multiple inheritance.

Abstract class can have final, non-final, static and non-static variables.Interface has only static and final variables.Interface can\'t have static methods, main method or constructor.

Abstract class can provide the implementation of interface.Interface can\'t provide the implementation of abstract class.The abstract keyword is used to declare abstract class.The interface keyword is used to declare interface.Variables declared in a Java interface is by default final. An abstract class may contain non-final variables.


By:Sumit Tripathi
Date:2020-05-15 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher