111,083
社区成员




- interface IMyInterface
- {
- void MyMethod();
- }
- class MyClass : IMyInterface
- {
- void IMyInterface.MyMethod()
- {
- Console.WriteLine("void IMyInterface.MyMethod()");
- }
- public void MyMethod()
- {
- Console.WriteLine("public void MyMethod()");
- }
- }
- class Test_Interface
- {
- public static void Main()//Main_1_5_3
- {
- MyClass mc = new MyClass();
- ((IMyInterface)mc).MyMethod();
- mc.MyMethod();
- Console.Read();
- }
- }
void IMyInterface.MyMethod()
{
Console.WriteLine("void IMyInterface.MyMethod()");
}