What is the difference between abstract class and interface?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please Disable the AdBlocker to Continue to the site.
Abstract Class:
– Every time a concrete subclass is instantiated, the default constructor of abstract classes is called.
– It includes both Non-Abstract and Abstract methods.
– Classes which extend Abstract should not have to implement all methods, only Abstract methods should be implemented in concrete sub-classes.
– Instance variables are present in abstract classes.
Interface:
– No constructor exists for it; hence it cannot be instantiated.
– Only the abstract method should be declared.
– The classes implementing the interface should implement all the methods.
– Only constants are present in the interface.