Overloading & Override in Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Overloading & Override in Java

Its seems to be confused for me cuz I couldn’t understand anything about it Can someone tell me how can i use it or send to me some links lessons about the topic

2nd Feb 2021, 4:38 PM
ANAS ADEL FAISAL AL-KAMEL
6 Answers
+ 5
D_Stark Indeed... 👌 It was that combination of "the same signature but different parameters" that immediately jumped out at me when reading your original response. As such, it wasn't clear if you thought "signature" referred only to the method name and did not apply to the parameter types. I only posted my explanation to help clarify the subtle distinction. 🤓
3rd Feb 2021, 5:03 AM
David Carroll
David Carroll - avatar
+ 4
D_Stark Regarding your explanation of method overloading, you wrote: "Overloading is wen [sic] you have 2 or more methods in the same class with the same signature but diffrent [sic] parameters" For clarification, "same signature" would imply same parameters. This can exist in the same class or sub classes as well. That is to say, the method signature includes both the method name and order of parameter types. Overloading involves different method signatures of the same method names. Overriding involves the same method signature with different implementations in sub classes.
2nd Feb 2021, 6:30 PM
David Carroll
David Carroll - avatar
2nd Feb 2021, 4:49 PM
Matias
Matias - avatar
+ 1
David Carroll I did mention diffrent parameters straight after, I was just trying to simplify it.. nevermind I'll delete it, yours seems clear enough to understand.
2nd Feb 2021, 8:03 PM
D_Stark
D_Stark - avatar
+ 1
David Carroll no problem 😁
3rd Feb 2021, 9:12 AM
D_Stark
D_Stark - avatar