Overriding List's Add()

后端 未结 6 1975
陌清茗
陌清茗 2020-12-20 18:59

Can\'t i overload List\'s Add method ?

class ListDemo:List
 {
    public override T  Add(T value)
   {
      return base.Add(valu         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-20 19:45

    Deriving from List is almost always pointless. See my answer to this other question for a full rundown:

    How to create a custom collection in .NET 2.0

提交回复
热议问题