Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the difference between overloading and overriding in object-orientated systems?
Posted
Updated 21-Jul-10 23:23pm
v3
Comments
LittleYellowBird 22-Jul-10 5:25am    
I have removed your email address and replaced it with a proper title. The title is there so that people know whether they want to read your question so it is best to make it descriptive and if you put your email address on public forums it only encourages spam. :)
Sandeep Mewara 22-Jul-10 5:57am    
Any beginner book would had told you that. Hope you have just not jumped to programming without reading one!

Overriding needs inheritance while overloading not.
In overriding method have same return type while in overloading it should be different.
Overriding method must be public while overloading may be different specifier.
If still you need more difference about this refer below link.
Thank you.
http://goo.gl/eh9sx6[^]
 
Share this answer
 
Overloading is when you define two methods with the same name in the same class but with different signatures.

Overriding is when you redefine a method that has already been defined in a parent class with ther same signature.

Overloading is resolved at compiletime. Overriding is mostly resolved at runtime, depending on language and situation. C++ and C# for example, are tricky in this respect, as methods are by default not overridable at runtime, but compile time (the virtual keyword controls this behaviour). The C# compiler will however issue warnings when it suspects you have got it wrong.

Hope that helps.
 
Share this answer
 
v2
Comments
E.F. Nijboer 22-Jul-10 5:31am    
Although the question is ridiculous, your answer is completely correct :)
E.F. Nijboer 22-Jul-10 5:32am    
Reason for my vote of 5
Good answer
Come on, are you serious? Just use google or look on the wiki page for oop.
 
Share this answer
 
1)In overloading,function name must be the same but with different signatures,In overloading,function name must be the same but with same signatures
2)In overloading,methods got different functionalities but in overriding we have to redefine the defination of the base class's method using override keyword
3)Overloading is know as early binding,Overriding is know as late binding
4)Overloading can be performed without inheritence but overriding can't

regards
Sajid Ahmed Shahsroha
 
Share this answer
 
v2
Comments
Sajid Ahmed Shahsroha 19-Mar-11 7:57am    
whoever downvoted me plz could you tell me why ?? so that i can improve myself
Member 10144694 18-Oct-13 5:57am    
you have to replace the word overloading with overriding in first line.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900