What is the difference between overloading and overriding a
function?

Answer Posted / raj kashyap

OVERLOADING is possible to create methods that have the same
name, but different parameters lists and different
definitions.overloading is used when objects are required to
perform similar task but using different parameters.



OVERRIDING is used when we want an object to respond to the
same method but have different behaviour when that method is
called. that means we override the method defined in super
class.yhis is possible by defining a method in subclass that
has same name,same argument& same return typeas method in
super class.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the volatile modifier for? : Java thread

734


How do you compare arrays in java?

696


When should I use singleton?

693


How do you use compareto method?

735


In how many ways we can do exception handling in java?

766


What does 0 mean in boolean?

736


Garbage collection in java?

775


What is communist flag?

767


What are static methods?

793


Which is easier .net or java?

833


How many inner classes can a class have?

790


Is null false in java?

918


How will you reverse a link list without using recursion?

776


5 Coding best practices you learned in java?

813


Why is inheritance used in java?

816