Summary
An Interface cannot implement methods.
An abstract class can implement methods.
An Interface can only inherit from another Interface.
An abstract class can inherit from a class and one or more interfaces.
An Interface cannot contain fields.
An abstract class can contain fields.
An Interface can contain property definitions.
An abstract class can implement a property.
An Interface cannot contain constructors or destructors.
An abstract class can contain constructors or destructors.
An Interface can be inherited from by structures.
An abstract class cannot be inherited from by structures.
http://en.csharp-online.net/Interfaces_and_Abstract_Classes
[see also
http://en.csharp-online.net/Should_I_use_an_abstract_class_or_an_interface%3F
]
An Interface can support multiple inheritance.
An abstract class cannot support multiple inheritance.
[edit]MSDN references
abstract (C# Reference)
Abstract and Sealed Classes and Class Members (C# Programming Guide)
Interfaces (C# Programming Guide)
Should I use an abstract class or an interface?
Subscribe to:
Post Comments (Atom)
How to check local and global angular versions
Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...
-
Most of the google tutorials on keras do not show how to display a confusion matrix for the solution. A confusion matrix can throw a clear l...
-
This error means you have created the DbContext but not configured/added it to the project using either DI in startup.cs or by using DbCon...
-
This happens when you dont define primary key for an entity type. Define a primary key either explicitly or implicitly.
No comments:
Post a Comment