3
我讀過自動實現的屬性不能只讀或只寫。他們只能讀寫。在接口中只讀和只寫自動屬性
但是,雖然學習接口,我碰到foll。代碼,它創建一個只讀/只寫和讀寫類型的自動屬性。這可以接受嗎?
public interface IPointy
{
// A read-write property in an interface would look like:
// retType PropName { get; set; }
// while a write-only property in an interface would be:
// retType PropName { set; }
byte Points { get; }
}