I am looking for a way to pass a method by reference. I understand that Java does not pass methods as parameters, however, I would like to get an alternative.
I\'ve
If you don't need these methods to return something, you could make them return Runnable objects.
private Runnable methodName (final int arg) { return (new Runnable() { public void run() { // do stuff with arg } }); }
Then use it like:
private void otherMethodName (Runnable arg){ arg.run(); }