MethodTable11Example -- stores executable code
(one method at a time) in an array and executes that code.
To see this example in action:
- Compile the Java source file, MethodTable11Example.java:
javac MethodTable11Example.java
- Run the class:
java MethodTable11Example
Output:
object's class: java.lang.String
object's superclass: java.lang.Object
object is a string.
object's representation as a string: 3.1415926536
object's class: java.lang.Double
object's superclass: java.lang.Number
object is not a string.
object's representation as a string: 3.1415926536
object's class: java.awt.Button
object's superclass: java.awt.Component
object is not a string.
object's representation as a string: java.awt.Button[button0,0,0,0x0,invalid,label=3.1415926536]
The source.