9
Reply

Method overloading is possible in interface ?

Rajesh Singh

Rajesh Singh

Nov 17, 2015
2.2k
0

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

    Sunil Gaded
    January 10, 2017
    0

    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); }

    Kshamesh Atnoorkar
    January 05, 2017
    0

    Yes. Its possible to overload the method in interface.

    Vishal Jadav
    August 20, 2016
    0

    yes

    Hiren Parmar
    August 15, 2016
    0

    Yes we can do method overloading in Interface.

    Avikshith Aradhya
    May 31, 2016
    0

    yes .

    Keerthi Venkatesan
    May 03, 2016
    0

    Yes, it is

    Shweta Lodha
    January 18, 2016
    0

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

    Vivek Bansod
    January 08, 2016
    0

    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();}}

    Rajesh Singh
    November 17, 2015
    0