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
Does java list allow null?
Explain how to force the garbage collection in java.
What is variable argument in java?
Does A Class Inherit The Constructors Of Its Superclass?
Which variables are stored in heap?
What is blank final variable?
What is difference between path and classpath?
Is java a utf 8 string?
What is the maximum size of byte array in java?
What are the access modifiers in java?
What are the main uses of this keyword?
What happens if we don’t override run method ?
What is the difference between iterator and enumeration ?
Is java code slower than native code?
What are the different data types in java?