Java方法返回泛型

簡單暴力的democode

@SuppressWarnings("unchecked")
public <T> T getTobj(Class<T> cls) {
	return (T)(new Object());
}
相關文章
相關標籤/搜索