using System;
namespace ConsoleApplication_C_Sharp
{
interface MyInterface
{
void Print();
int GetNumber(int number);
}
class MyClass : MyInterface
{
public void Print()
{
Console.WriteLine("MyClass : MyInterface Print()");
}
public int GetNumber(int number)
{
return number;
}
}
class MySubClass : MyClass, MyInterface
{
public new void Print()
{
Console.WriteLine("MySubClass : MyClass, MyInterface Print()");
}
}
class Program
{
static void Main(string[] args)
{
MyInterface myinterface = new MySubClass();
myinterface.Print();
Console.WriteLine(myinterface.GetNumber(300));
}
}
}
/*
run:
MySubClass : MyClass, MyInterface Print()
300
*/