Method.invoke() is used for runtime method execution.
By using Method.invoke(), you can execute methods on objects whose classes are not known until runtime. This is particularly useful in scenarios like implementing a command pattern where different command objects execute different functions. For instance, in a game engine, you might execute actions like 'jump' or 'shoot' based on user input dynamically.