Here you can find the source of getMethod(Class clazz, String name, Class>... args)
public static Method getMethod(Class clazz, String name, Class<?>... args)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static Method getMethod(Class clazz, String name, Class<?>... args) { Method method = null;//from w ww .j a va 2 s .c o m try { method = clazz.getMethod(name, args); } catch (NoSuchMethodException e) { try { method = clazz.getDeclaredMethod(name, args); } catch (NoSuchMethodException e2) { } } return method; } }