Java tutorial
//package com.java2s; public class Main { @SuppressWarnings("unchecked") public static boolean hasMethod(Class clazz, String methodName, Class paramTypes[]) { try { clazz.getMethod(methodName, paramTypes); return true; } catch (NoSuchMethodException ex) { return false; } } }