Can I overload a method by creating methods with the same name but changing both the return type and the parameters? Or does it work only when I change the parameters... | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Can I overload a method by creating methods with the same name but changing both the return type and the parameters? Or does it work only when I change the parameters...

24th Aug 2016, 1:37 PM
Victor Pietro Moreno
Victor Pietro Moreno - avatar
2 ответов
+ 2
parameters actually go with return type...u can't possibly return a double for an int parameter
13th Oct 2016, 8:53 PM
Maduekwe Ebuka Collins
Maduekwe Ebuka Collins - avatar
0
you can do that, if you change both it works
31st Aug 2016, 6:47 AM
Behzad Bakhti
Behzad Bakhti - avatar