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

Does java list allow null?

547


Explain how to force the garbage collection in java.

535


What is variable argument in java?

559


Does A Class Inherit The Constructors Of Its Superclass?

538


Which variables are stored in heap?

542






What is blank final variable?

567


What is difference between path and classpath?

564


Is java a utf 8 string?

532


What is the maximum size of byte array in java?

540


What are the access modifiers in java?

588


What are the main uses of this keyword?

601


What happens if we don’t override run method ?

571


What is the difference between iterator and enumeration ?

514


Is java code slower than native code?

559


What are the different data types in java?

533