Rajesh Singh
Method overloading is possible in interface ?
By Rajesh Singh in C# on Nov 17 2015
  • Sunil Gaded
    Jan, 2017 10

    Yes we can Interface IBase {int Method(int s,int p);int Method(int q); }

    • 0
  • Kshamesh Atnoorkar
    Jan, 2017 5

    Yes it's possible, but I would never prefer it and force the users to overload it if they don't need it. I can simply create two interfaces and let the users implement if they need, it will be more flexible and maintainablepublic interface IDoSomethingInterface // discard this interface {void DoSomething(String x);void DoSomething(int a); }public interface IDoSomethingInterfaceWitString {void DoSomething(String x); }public interface IDoSomethingInterfaceWithInt {void DoSomething(int a); }

    • 0
  • Vishal Jadav
    Aug, 2016 20

    Yes. Its possible to overload the method in interface.

    • 0
  • Hiren Parmar
    Aug, 2016 15

    yes

    • 0
  • Avikshith Aradhya
    May, 2016 31

    Yes we can do method overloading in Interface.

    • 0
  • Keerthi Venkatesan
    May, 2016 3

    yes .

    • 0
  • Shweta Lodha
    Jan, 2016 18

    Yes, it is

    • 0
  • Vivek Bansod
    Jan, 2016 8

    Yes, it is possible but found it has been rarely used

    • 0
  • Rajesh Singh
    Nov, 2015 17

    yes,public interface bas1 {void Disp1();void Disp1(int x);}abstract class MyClass : bas1{public void Disp1(){throw new NotImplementedException();}public void Disp1(int x){throw new NotImplementedException();}}

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS