Not possible using "ordinary" Java, but possible using the "reflection" classes - have a look at the class java.lang.reflect.Method to get a quick flavour of what its all about. I can give you a lot more info on reflection if this looks like a direction you wan to go in.

In summary you get the Class of each classes containing your methods (Java refers to "functions" as "methods"), then from the Class get the Method objects representing the methods themselves. You can store those in an array of Methods. You can use "invoke" to invoke any of those methods with whatever parameters they need. It's a bit of a slog the very first time you do it, but once you get the first one sorted it's easy, and the code can be very compact.

(I tried to answer the question exactly as you asked it but depending on what your underlying requirement is, that may not have been the right question. For example, if you just want to call one of n methods based on an integer index 1..n it may be simpler just to have a switch with the method calls hard-coded for each case.)

Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...