Interface in C#
An Interface is a User
Defined Type, and it will contain only the Abstract Method, it is required or
mandate to implement the abstract method of Interface in the Child Class. In
Other Words, it is defined as abstract method without abstract class.
Abstract Methods à Defining the
declaration of method I.e. Method without method body and the implementation of
this method is available in the child class.
Example,
interface IDemo// Interface
{
void InterfaceDisplay();// Declaring a method
in Interface.
void InterfaceDisplay2();// Declaring a method
in Interface.
}
The process of implementing
the method Declared in the Interface class will be implemented in the child
Class. These are mainly derived from the Base library – “System” Class.
Example,
Comments
Post a Comment