The first parameter is the object to which the method belongs (if it is a static method, you can pass null directly)
The second variable parameter is the parameter of the method
Method.invoke() itself uses an array to wrap the parameters; and each call must check the visibility of the method (in Method.invoke()), and also check the type matching of each actual parameter and the formal parameter (in NativeMethodAccessorImpl .invoke0() or the generated Java version MethodAccessor.invoke())
1. Implementation Principle
Invoke() is not actually the reflection call logic implemented by itself, but is delegated to sun.reflect.MethodAccessor for processing. Each actual Java method has only one corresponding Method object as the root, and this root will not be exposed to the user , But every time a Method object is obtained through reflection, a new Method object is created to wrap the root and then given to the user. Before the invoke() method of the Method object corresponding to an actual Java method is called for the first time, the MethodAccessor of the calling logic is implemented. The object has not been created yet, wait for the first call to create a new MethodAccessor and update it to root, and then call MethodAccessor.invoke() to actually complete the reflection call