Here you can find the source of invokeMethodWithNoArgs(Object o, Method method)
public static Object invokeMethodWithNoArgs(Object o, Method method)
//package com.java2s; //License from project: Apache License import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { public static Object invokeMethodWithNoArgs(Object o, Method method) { try {// w ww . ja v a 2 s. com return method.invoke(o); } catch (InvocationTargetException | IllegalAccessException e) { return null; } } }