Creating two methods with same signature in two different interfaces
and implementing bothinterfacesinthesame child class.
示例
//method for IPerson.GetAge method
int IPerson.GetAge()
{
int a = System.Convert.ToInt32((System.DateTime.Now - DateOfBirth).TotalDays / 365);
return a;
}
//method for IEmployee.GetAge method
int IEmployee.GetAge()
{
return 20;
}
相当于接口私有的方法,所以不能加Public。