InvokeMethodDynamically11Example -- invokes a method
based on run-time information in strings.
To see this example in action:
- Compile the Java source file, InvokeMethodDynamically11Example.java:
javac InvokeMethodDynamically11Example.java
- Run the class:
java InvokeMethodDynamically11Example
Output:
s1 = "2"
s2 = "34"
s3 = "5678"
The source.