Here you can find the source of invoke(Method m, Object target, Object... params)
public static Object invoke(Method m, Object target, Object... params)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Object invoke(Method m, Object target, Object... params) { try {/*from w w w. ja va 2s . c o m*/ m.setAccessible(true); return m.invoke(target, params); } catch (Exception e) { throw new RuntimeException(e); } } }