接口解决多继承之解决重名重命名问题---CSDN
using System;
interface IA
{
void Paint();
}
interface IB
{
void Paint();
}
class SomeClass:IA,IB
{
void IA.Paint()//顯示接...解决重名问题
{
Console.WriteLine( "IA.Paint ");
}
void IB.Paint()
{
Console.WriteLine( "IB.Paint ");
}
};
public class Test
{
public static void Main()
{
IA a = new SomeClass();
a.Paint();
IB b = new SomeClass();
b.Paint();
Console.ReadLine();
}
};