0

I want to do overloading. I make two method same name return different type. I have errors. How can i do it? Thank you.

Overloading (method). https://code.sololearn.com/c8VOGuBphg9S/?ref=app

3rd Jun 2020, 6:46 AM
Malick Diagne
Malick Diagne - avatar
2 Réponses
+ 1
They may not return different types, this is essential part of the method signature. Methods can be overloaded with different parameterization (type and number of parameters may differ).
3rd Jun 2020, 6:50 AM
Sandra Meyer
Sandra Meyer - avatar
0
Overloading has to have different number of parameters or different types of parameters I don't think just changing the return type helps
3rd Jun 2020, 6:51 AM
Eliya Ben Baruch
Eliya Ben Baruch - avatar