On Mon, 27 Sep 2004 00:01:11 +1000, danjourno wrote:
Is there any way of referencing a method or field dynamically by a name
contained in a string?
thanks
D
Method m = obj.getClass().getMethod(methodname, Object[] parameters)
returns the method you want to call on obj. To invoke it:
m.invoke(obj, Object[] parameters)
You can see the Method class in java.lang.reflect
Tony