📜  java中的newinstance给出异常 - Java代码示例

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

代码示例1
Class       integerDefinition   = Class.forName("java.lang.Integer");
Constructor intArgsConstructor  = integerDefinition.getConstructor(new Class[] {int.class});
Object[]    intArgs             = new Object[] { new Integer(12) };
Object      object              = intArgsConstructor.newInstance(intArgs);