Here you can find the source of invoke(Method method, Object obj, Object... args)
private static Object invoke(Method method, Object obj, Object... args)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { private static Object invoke(Method method, Object obj, Object... args) { try {/*from www. j a va2 s. co m*/ return method.invoke(obj, args); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } catch (InvocationTargetException e) { throw new IllegalArgumentException("Can't invoke method " + method.getName(), e); } } }