A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Joined: Oct 03, 2002
Apr 01, 2003 07:28:00
public Method getMethod(String name, Class parameterTypes) throws NoSuchMethodException, SecurityException
I understand thru the api that name refers to method name, but what is the purpose of parameterTypes??
Sunita<br />SCJP 1.4
Joined: Mar 31, 2003
Apr 01, 2003 07:44:00
I'm not sure, but I think that the Class parameters array is to distinguish between methods that might have the same name, but different arguments. I'm not sure if these have to be in the order declared in the method or not.
Joined: Feb 26, 2001
Apr 01, 2003 07:46:00
Yes, they are; and yes, they do.
I agree. Here's the link:
Calling Methods with strings??
java. lang .reflection .Method .invoke()
reflection - invoking Methods by Name!!!
getMethod(); - reflection problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014