【发布时间】:2011-03-07 21:37:13
【问题描述】:
可能重复:
Is there a reason you can not define the access modifier on a method or in an interface?
你好,
我对接口很好奇。假设我有以下接口的定义
public interface IPersone
{
string FirstName { get; set; }
string LastName { get; set; }
int CalculateAge(int YearOfBirth);
}
为什么在定义接口的方法和属性前面没有修饰符(public、private、protected)?有什么原因吗?
感谢您的帮助
【问题讨论】:
标签: c#