Say, if I need to override ToString method in a custom List, I'd do this:
public class WebUILanguage2 : List<WebUILanguage>
{
public override string ToString()
{
return "Overridden message";
}
}
but what if I want to override this?
public class WebUILanguage2 : WebUILanguage[]
You can't. You can't derive from array types.
I'd generally advise against overriding ToString in List<T>, too - usually it's better to use composition than inheritance for things like this, in my experience.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With