Here you can find the source of getMethod(Class c, String name)
public static Method getMethod(Class c, String name)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Method getMethod(Class c, String name) { for (Method method : c.getDeclaredMethods()) { if (method.getName().equals(name)) { return method; }//from ww w . j a v a2 s . c o m } throw new IllegalArgumentException("Unknown method '" + name + "' on " + c); } }