C#.NET Generic Methods and Inheritance.

Posted by ealgestorm on Stack Overflow See other posts from Stack Overflow or by ealgestorm
Published on 2010-05-20T02:09:57Z Indexed on 2010/05/20 2:20 UTC
Read the original article Hit count: 230

Filed under:
|
|

Is it possible to do the following with generics in C#.NET

public abstract class A
{
    public abstract T MethodB<T>(string s);
}

public class C: A
{
    public override DateTime MethodB(string s)
    {
    }
}

i.e. have a generic method in a base class and then use a specific type for that method in a sub class.

© Stack Overflow or respective owner

Related posts about c#

Related posts about generics