Casting an object reference to invoke a method
- Last Updated: December 9, 2013
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
The following example shows an alternative Main class
used to access the sample classes SuperClass and SubClass defined
in the previous example, this time to demonstrate the use of the CAST function
to cast an object reference for a method call:
|
In the previous example, the constructor sets the SuperClass object
reference to a new SubClass instance, then invokes subClassMethod( ) on
the SubClass instance by casting the SuperClass object
reference to SubClass.