嗨!我是一个尝试Java的人.所以我将如何在java中执行以下操作.
在C#中
public T create_an_instance_of<T>(){
T instance = default (T);
// here's usually some factory to create the implementation
instance = some_factory.build<T>();
// or even..
instance = some_factory.build(typeOf(T) );
return instance;
}
Run Code Online (Sandbox Code Playgroud)