Interface | Abstract Class |
---|---|
Interface is nothing but contract of the system which can be implemented on classes. | Abstract class is special kind of class that can not be instantiated but can be inherited. |
A class may inherit several interfaces. | A class may inherit only one abstract class. |
An interface cannot provide any code, just the signature. | An abstract class can provide signature as well as code to be overridden in the child classes. |
Members of interface does not have any access modifier. | Members of abstract class have an access modifier. |
An interface can not contain fields, constructor, destructor. | An abstract class can contain fields, constructor, destructor. |
A class implementing an interface has to implement all the methods of the interface | A class implementing an abstract class does not need to implement all the methods of the abstract class |
If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method. | If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly. |
Reference can be created, it depends on child class object's memory. | Reference can not be created. |
Thursday, February 5, 2015
Difference between Interface and Abstract Class
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Problem Statement - While creating Power Automate we may face situation where connection reference for the Dataverse Connector missing and w...
-
Many times, it happens that we get an error or exception message while working on the Dynamics 365 UCI form . So, to get more informatio...
-
Objective - To Create Guid PCF Control Pre-Requisites Install Node Js - https://nodejs.org/en/ Install Power Apps CLI - http://download.mi...
-
1. Clone Repository – Login to Azure Devops, open Project, go to Repos and click on “Clone” Note – Here we are using the reposi...
-
Microsoft is about to bring low code power for Model-driven Power Apps and Dataverse using Power Fx. Some areas of innovation: Model-driven ...
No comments:
Post a Comment