Here you can find the source of getMethodCount(Class> clazz, String methodName)
public static int getMethodCount(Class<?> clazz, String methodName)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static int getMethodCount(Class<?> clazz, String methodName) { int count = 0; do {// w ww . j a va 2s . c o m for (int i = 0; i < clazz.getDeclaredMethods().length; i++) { Method method = clazz.getDeclaredMethods()[i]; if (methodName.equals(method.getName())) { count++; } } clazz = clazz.getSuperclass(); } while (clazz != null); return count; } }