Class [] argsClass = new Class [2];
argsClass[0] = Integer.class;
argsClass[1] = String.class;
User user2 = (User) userClass.getConstructor(argsClass).newInstance(new Object[]{12, "awe"});
error message:
java.lang.NoSuchMethodException: com.bean.User. < init > (java.lang.Integer, java.lang.String)
at java.base/java.lang.Class.getConstructor0(Class.java:3322)
at java.base/java.lang.Class.getConstructor(Class.java:2108)