[英]How to restrict the interface implementation in c#
沒錯,但是KeyCollection
沒有任何限制。 KeyCollection
似乎正在使用ICollection
和ICollection<TKey>
方法。 實際上,它實現了所有方法。 因為ICollection<TKey>
和ICollection
實現IEnumerable<T>, IEnumerable
接口。
ICollection<T> : IEnumerable<T>, IEnumerable
ICollection : IEnumerable
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.