Java – Creating an array of methods
Whenever you think of pointer-to-function, you translate to Java by using the Adapter pattern (or a variation). It would be something like this: public class Node { … public void goNorth() { … } public void goSouth() { … } public void goEast() { … } public void goWest() { … } interface MoveAction { … Read more