locked
Casting in Generics RRS feed

  • Question

  • Class Animal

    {

    }

    Class Dog : Animal

    {

    }

    Class Cat : Animal

    {

    }

    Class Group<T> where T : Animal

    {

    }

    Group<Dog> group = new Group<Dog>();

    How can i cast group as Group<Animal>?

    Seems like this is not supported, is there a way around this?


    pn
    Wednesday, September 15, 2010 4:51 PM

Answers

All replies