본문 바로가기
Programming

Dynamic Invocation In JAVA (동적 메쏘드 호출)

by leanu 2010. 1. 19.
자바에 이런 기능이 있다니 참으로 놀랍다.

특정 클래스에는 어떤메쏘드가 있으며 
그에 따른 파라미터 타입이라던지 특정 메소드 호출까지 제어할 수있다.



결과

------------------------------------------ Method Name : testMethodOne Method Name with param : public void TestClass.testMethodOne() Method Param No : 0 testMethodOne is called ------------------------------------------ Method Name : testMethodTwo Method Name with param : public void TestClass.testMethodTwo(int) Method Param No : 1 testMethodTwo is called : 10 ------------------------------------------ Method Name : testMethodThree Method Name with param : public void TestClass.testMethodThree(int,java.lang.String) Method Param No : 2 testMethodThree is called10 Test String ------------------------------------------ Method Name : testMethodFour Method Name with param : private void TestClass.testMethodFour(int,java.lang.String,java.lang.String) Method Param No : 3

'Programming' 카테고리의 다른 글

beanstalkd - fast workqueue service  (0) 2010.03.02
bash shell 인자 개수 처리  (0) 2010.02.01
Java newline characters  (0) 2010.01.15
Java string comparison  (0) 2010.01.07
서버에서 SIGPIPE 처리하기  (0) 2009.11.24

댓글