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
How many digits is int32?
What are methods in java?
What are aggregate functions explain with examples?
What is string and example?
Is hashset ordered?
What is a prefix function.write down a code to compute prefix function.
What is pass by value?
Why javac is not recognized?
Can java list contain duplicates?
What happens when a thread cannot acquire a lock on an object in java programming?
What are packages in java?
Can string be considered as a keyword?
What is a type parameter in java?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
Is static a singleton?