Friday, October 4, 2019

Difference between Abstract and Interface class


Abstract Interface
An abstract is a class in which abstract as well as non extract member are present. While in interface all the method must have to be abstract.
An abstract class can declare or use any variables In interface it is not allowed to do so.
An abstract all functions are private by default. While in interface all functions are public.
In this, we must use a word 'abstract' to declare abstract method. In interface we don't need to use that.
This class can't be used for multiple inheritance. Interface can be used as multiple inheritance.
An abstract class have constructor. In interface, we don't have any constructor.
An abstract class can inherit only one abstract class. Interface class can implement any number of interface.

No comments:

Post a Comment