0
SubArray = Key.Ikey;

Ikey being the variable which holds the name of the method.

I tried:

SubArray = Key.(this.IKey);

but the compiler gave the error identifier excpected.

bobbel
  • 3,031
  • 2
  • 24
  • 41
Fence_rider
  • 128
  • 1
  • 11

1 Answers1

2

I think you are interested in reflection. It goes something like:

method = object.getClass().getMethod(methodName, param1.class, param2.class, ..);

So you are calling the method specified by the variable 'methodName' of the object 'object'

You can read more here Reflection

and in this tutorial link

Community
  • 1
  • 1
fersarr
  • 3,049
  • 3
  • 26
  • 35