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.
假设我获得了我作为String. 如何使用包含在该字符串中的名称实例化类?我知道它会派生自某个父类,但实际类会有所不同。
String
var instance : MyClass = Type.createInstance(Type.resolveClass("path.to.MyClass"), []);
几点注意事项:
resolveClass()
createInstance()