-1

Today one company interviewer asked me what is this program, is it overloading or is it overriding?

int a(int n1, int n2)
float a(int n1, int n2)
Yannis
  • 1,682
  • 7
  • 27
  • 45
  • Possible duplicate of [Why is method overloading and overriding needed in java?](https://stackoverflow.com/questions/14228520/why-is-method-overloading-and-overriding-needed-in-java) – C-Otto Jan 16 '18 at 15:22
  • 1
    Possible duplicate of [Polymorphism vs Overriding vs Overloading](https://stackoverflow.com/questions/154577/polymorphism-vs-overriding-vs-overloading) – Szymon Stepniak Jan 16 '18 at 15:25

1 Answers1

1

it is overloading because some of the modern language support this methodology

overloading by return type is possible and is done by some modern languages. The usual objection is that in code like

int func();
string func();
int main() { func(); }
Hoque MD Zahidul
  • 10,560
  • 2
  • 37
  • 40