Here you can find the source of getMethod(String className, String methodName, Class>[] params)
Parameter | Description |
---|---|
className | a parameter |
methodName | a parameter |
params | a parameter |
Parameter | Description |
---|---|
ClassNotFoundException | an exception |
NoSuchMethodException | an exception |
SecurityException | an exception |
public static Method getMethod(String className, String methodName, Class<?>[] params) throws ClassNotFoundException, NoSuchMethodException, SecurityException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { /**// w ww . ja v a 2 s . c om * * @param className * @param methodName * @param params * * @return Returns the Method object from the specified class name, method name and parameters of this method. * * @throws ClassNotFoundException * @throws NoSuchMethodException * @throws SecurityException */ public static Method getMethod(String className, String methodName, Class<?>[] params) throws ClassNotFoundException, NoSuchMethodException, SecurityException { Class<?> clazz = Class.forName(className); return clazz.getMethod(methodName, params); } }