A: 

What you are looking for is reflection, here is a similar question: http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string

krock
+1  A: 

Use reflection.

Here's an example

patros
+1  A: 

Easily done with reflection. Some examples here and here.

The main bits of code being

String aMethod = "myMethod";

Object iClass = thisClass.newInstance();
// get the method
Method thisMethod = thisClass.getDeclaredMethod(aMethod, params);
// call the method
thisMethod.invoke(iClass, paramsObj);
Robin
+4  A: 

Yes, you can, using reflection. However, consider also Effective Java 2nd Edition, Item 53: Prefer interfaces to reflection. If at all possible, use interfaces instead. Reflection is rarely truly needed in general application code.

See also

Related questions

polygenelubricants
A: 

With the reflection API. Something like this:

    Method method = getClass().getDeclaredMethod(functionName);
    method.invoke(this);
unbeli