📜  java 通过字符串获取类 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:26.114000             🧑  作者: Mango

代码示例2
//get an according class variable
String className = "MyClass";
Class cls = Class.forName(className);

//create instance of that class
Object myInstance = scl.newInstance();