Dillip Nayak
How can we implement the two interfaces having same method names ?
By Dillip Nayak in .NET on Oct 15 2014
  • Dillip Nayak
    Oct, 2014 15

    yes,By explicit interface implementationExample:protected void Page_Load(object sender, EventArgs e){I1 obj1 = new A();I2 obj2 = new A();lblResult1.Text = obj1.Interview();lblResult2.Text = obj2.Interview();}interface I1{string Interview();}interface I2{string Interview();}class A : I1, I2{string I1.Interview(){return "Result2";}string I2.Interview(){return "Result";}}

    • 1
  • pardhu utlapalli
    Jun, 2015 23

    Interface Interface1 { void Add(); } interface Interface2 { void Add(); }public class Baseclass :interface1,Interface2 { Interface.Add() { console.Writeline(); } Interface.Add() { Console.writeline(); } Public Static Void Main() { baseclass b=new baseclass(); interface1 f1=b; b.add(); interface2 f2=b; b.add(); } }

    • 0
  • Sneha Panda
    Dec, 2014 15

    i am agree with dillip

    • 0
  • Prakash Lakshmanan
    Dec, 2014 15

    Refer this link: http://msdn.microsoft.com/en-us/library/ms173157.aspx

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS