adplus-dvertising
frame-decoration

Question

In order to avoid ambiguity among an interface derived from two base interfaces with same method name(and signature), the right code among the following given codes is?
a)

 interface i1
 {
     void m1();
 }
 interface i2
 {
     void m1();
 }
 interface i3 :i1, i2
 {
 }
 class c3 :i3
 {
     void i1.m1()
     {
     }
     void i1.m1()
     {
     } 
}

b)
 interface i1
 {
     void m1();
 }
     interface i2
     {
         void m1();
     }
     interface i3 :i1, i2
     {
     }
     class c3 :i3
     {
         void i1.i2.m1()
         {
         }
     }

c)
  interface i1
  {
      void m1();
  }
  interface i2
  {
      void m1();
  }
  interface i3 :i1, i2
  {
  }
  class c3 :i3
  {
      void i1.m1()
      {
      }
      void i2.m1()
      {
      }
  }

a.

a

b.

b

c.

c

d.

All of the mentioned

Posted under C# programming

Answer: (c).c

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. In order to avoid ambiguity among an interface derived from two base interfaces with same method name(and signature), the right code among the following given codes is?