Here you can find the source of invoke(Object thisObject, Method method)
public static <T> T invoke(Object thisObject, Method method) throws IllegalAccessException, InvocationTargetException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { public static final Class<?>[] NO_PARAM_SIGNATURE = new Class<?>[0]; public static <T> T invoke(Object thisObject, Method method) throws IllegalAccessException, InvocationTargetException { return (T) method.invoke(thisObject, NO_PARAM_SIGNATURE); }//from w w w. j a va2 s . c o m public static <T> T invoke(Object thisObject, Method method, Object parameter) throws IllegalAccessException, InvocationTargetException { return (T) method.invoke(thisObject, parameter); } }