개발하자/JSP&Servlet
원하는 메서드 이름 얻어오기 getDeclaredMethod
i구야
2015. 3. 28. 10:56
import java.lang.reflect.*;
class A{
void a(){}
void b(){}
int c(){ return 100; }
}
class B{
public static void main(String args[]) throws NoSuchMethodException {
Class<A> o=A.class;
System.out.println(o.getDeclaredMethod("c")); //원하는 메서드 이름 얻어오기
}
}