Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
public <T extends java.util.EventListener> T[] getListeners(final Class<T> listenerClass) { ... }
上述 java 泛型的等效 c# 泛型表示法是什么?
参数 listenerClass 将是一个类型而不是一个对象。但是对象 T 必须属于特定的层次结构。
public T[] GetListeners<T>() where T : EventListener { }