|
June 9, 2002 Multiple Inheritance of Interfaces Tips: June 2002
Yehuda Shiran, Ph.D.
|
|
Let's implement the following two interfaces:
by the myClass class. It implements both of these interfaces, providing the body of the printSomething() function:
Let's create a new instance of myClass:
Let's define two variables as having the types of the interfaces above, and assign them the demo instance above:
Now all three variables (demo, inter1, inter2) share the same implementation of printSomething(), because they all reference the same instance, demo. The following code:
yields three identical lines:
To learn more about JScript .NET, go to Column 110, JScript .NET, Part IV: Inheritance.
People who read this tip also read these tips: Look for similar tips by subject: |