Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

inhertitence

Former Member
0 Kudos

can we simulate multiple inheritence using interfaces? if yes , how?

3 REPLIES 3

Former Member
0 Kudos

Hi,

A class, though, may implement multiple interfaces. This is also called multiple inheritance. In JScript .NET, multiple inheritance is supported only for interfaces. Here are two interfaces:

interface FirstInter{
    function printSomething();
  }

  interface SecondInter{
    function printSomething();
  }
The class myClass implements both of these interfaces, providing the body of the printSomething() function:

  class myClass implements FirstInter, SecondInter {
    function printSomething() {
      print("This is something else");
    }
  }

Best regards,

raam

0 Kudos

thanks ram!

can i say multiple inheritance is simulated when a class implements two independent interfaces and also would it be right to say multiple inheritance is simulated using compound interfaces?