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
Can we increase size of array?
State the merge-sort principle and its time complexity.
Discuss about garbage collector in Java.
Which method cannot be overridden in java?
What is java util hashmap?
What is the purpose of static methods and static variables?
How does linkedlist work in java?
Why we used break and continue statement in java?
List some java keywords sun like c, c + + keywords?
Is void a return type?
Is there any difference between nested classes and inner classes?
What is the purpose of lambda expressions?
What are the steps in the jdbc connection?
What is arguments in java?
Explain the importance of throws keyword in java?