class Program: abc { static void Main(string[] args) { Console.WriteLine("hello interface"); xyz(); Console.ReadLine(); return; } public void xyz() { Console.WriteLine("interface XYZ"); } } interface abc { void xyz(); }
Main()
abc testObject = new Program(); //The object is declared as interface "abc" but could be also declared of type "Program"! testObject.xyz();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)