C # generics & not going insane

public <T extends java.util.EventListener> T[] getListeners(final Class<T> listenerClass) { ... } 

What is the equivalent notation of C # generics for the above java generics?

The listenerClass parameter will be a type, not an object. But the object T must belong to a certain hierarchy.

+7
source share
1 answer
 public T[] GetListeners<T>() where T : EventListener { } 
+13
source

All Articles