Here you can find the source of invokeMethod(Object parent, String method, Class>[] paramTypes, Object[] args)
public static void invokeMethod(Object parent, String method, Class<?>[] paramTypes, Object[] args)
//package com.java2s; //License from project: Apache License import java.lang.reflect.InvocationTargetException; public class Main { public static void invokeMethod(Object parent, String method, Class<?>[] paramTypes, Object[] args) { try {/*from w w w .ja v a 2 s. c o m*/ parent.getClass().getMethod(method, paramTypes).invoke(parent, args); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } } }