Hi,
<ta*******@gmail.com> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
Hi,
Can generics be used to call a static method of a class? The below
example gives an error in my generictest class. Anybody know why?
Remember that you need to use the type to invoke a static method. Generic is
quite the opposite, you do not especify the type until runtime.
Even if the static method is member of the generic constrain you cannot use
it, as you can use a derived type to instantiate and the derived type does
not implement the static method (the base does) .
The only way to do this (in case that you really need to) is using
reflection, you would have to deal with the case that the static method is
not present though.
What are you trying to do?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation