Multiple inheritance is not supported by the CLR and all managed languages, and is implemented through an interface simulation
14.1 Implementations of classes and interfaces
Interface definition: A way to specify a name for a set of method signatures.
Class to implement an interface, you must provide implementations of all the methods of the interface.
Even though an abstract class is implemented in its entirety, it can declare an interface method abstract, leaving the interface method to be implemented by a derived class, as follows:
Public interface ITest
{
void Test ();
Public
abstract class Abstractclass:itest
{public
abstract void Test ();
Public
class Concreateclass:abstractclass
{public
override void Test ()
{
//coding Implementation;
}
}
14.2 Defining interfaces
The interface can have a method/Event/property, because the latter is essentially a method
There can be no static members (including constants/enumerations) in an interface
Interfaces can be "inherited", which can be thought of as a convention that contains another interface, not a true inheritance
All members under the interface, default to public, without declaring
14.3 Implementation Interface
Implements an interface method that must be marked public, in which case virtual and sealed are not allowed to be overridden by subclasses (when new is not used either).
To show that the calling interface method is marked as virtual, you can override the method in a subclass
If the display is marked as sealed, then you cannot rewrite the