假设您具有以下构造函数class MyClass { public MyClass(Long l, String s, int i) { }}您将需要证明打算使用该构造函数,如下所示:Class classToLoad = MyClass.class;Class[] cArg = new Class[3]; //Our constructor has 3 argumentscArg[0] = Long.class; //First argument is of *object* type LongcArg[1] = String.class; //Second argument is of *object* type StringcArg[2] = int.class; //Third argument is of *primitive* type intLong l = new Long(88);String s = "text";int i = 5;classToLoad.getDeclaredConstructor(cArg).newInstance(l, s, i);