The key word interface is use to define an interface. When you define interface you have not to define access modifier of any function (method) all method is public and in interface only declare method you cannot define method in interface.
public void print()
Console.WriteLine("this is interface method");
public static void Main(string args)
Program obj = new Program();
Some rule for Method Overriding : 1). you cannot define method in interface.
2). you cannot define variable in interface.
3). you have to define method in class which interties the interface.
4). you can only declare method in interface.
See Also :
- What is Class and Object in C#.net ?
- What is Encapsulation in C#.Net ?
- What is Abstract Class in C#.Net,How to use Abstract class in .net?
- Wht is Inheritance in c#.net ?
- What is Method Overloading in .Net?