I'm using .net framework 4.0
I want to create a generic method inside a non-generic class
but it gives me compile time error
Error :The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
public class BlIAllClass
{
public static List<T> xyz()
{
List<T> cc = new List<T>();
return cc;
}
}
Also there is a question asked by John Paul Jones
Generic Method in non generic class
There he mentioned that it is possible to create generic method inside non-generic class.
Then what's wrong with my code.
Is it framework version related issue or i'm missing something