我想将一个Class对象传递给一个函数,然后声明一个类所在类型的ArrayList.我想知道我是怎么做到的.
public static void CreateList(Class c){
// I want to create this array list using the variable c to define its type
ArrayList<c> list = new ArrayList();
}
Run Code Online (Sandbox Code Playgroud)