Can't i overload List's Add method ?
class ListDemo<T>:List<T>
{
public override T Add<T>(T value)
{
return base.Add(value);
}
}
I am receiving the following error :
1) Type parameter 'T' has the same name as the type parameter from outer type 'CollectionsExample.ListDemo
2) 'CollectionsExample.ListDemo.Add(T)': no suitable method found to override
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…