Null and the method is an instance method. NullPointerException - if the specified instance is Parameter type by a method invocation conversion. Parameter value cannot be converted to the corresponding formal Primitive arguments fails or if, after possible unwrapping, a Of a subclass or implementor thereof) if the number of actualĪnd formal parameters differ if an unwrapping conversion for Of the class or interface declaring the underlying method (or The specified instance argument is not an instance IllegalArgumentException - if the method is an instance method and If the initialization provoked by this method fails. Inaccessible or if the underlying method throws an exception or Language access control and the underlying method is Type is void Throws: RuntimeException - if this Method object enforces Java
![java reflection javadoc java reflection javadoc](https://dotnettutorials.net/wp-content/uploads/2020/08/word-image-137.png)
![java reflection javadoc java reflection javadoc](https://sanet.pics/storage-5/0419/wjbadFlgIKdJWkabNGEjTHcaCGi20irw.jpg)
Parameters: setAccessible - flag indicating whether method should first be set asĪccessible method - the method to invoke instance - the instance to invoke the method args - the arguments to the method Returns: the result of invoking the method, or null if the method's return PrivilegedAction before invoking the method. If instructed, this method attempts to set the accessible flag of the method in a This method wraps Method.invoke(Object, Object.), converting theĬhecked exceptions that Method.invoke(Object, Object.) specifies The result of invoking the method to the expected return type. Invoke the method on the instance, with any arguments specified, casting