0
Overloading java question
is this code consider a overloading code?why is it not running? https://code.sololearn.com/c9Ih55tKg1hw/?ref=app
7 Respostas
+ 8
Yeah, it's correct. Keep it up :)
+ 7
method's return type can't be both void and int at the same time. Make them only void, erase int and double from method signatures.
+ 3
Yes, overloading is defined as using a method with the exact same method name within the same class in which each overloaded method has a different number and/or type of parameter(s). The return type doesn't matter.
+ 1
You have your function return types as double and int, yet they are not returning any value. If you want to return a value then you need to add the return statements to each function, otherwise change the functions return types to void.
+ 1
You need to change them to void, not void double and void int, just void.
0
i have added void but it is still not working
0
thankyou all.i forgot about this.btw did i use overloading correctly here?