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
What does pointer mean?
What are the new features in java 8? Explain
How can you avoid serialization in child class if the base class is implementing the serializable interface?
Is a char always 1 byte?
What is difference between string and stringbuffer?
What do you mean by aggregation?
Can we extend private class in java?
How do you format in java?
Why are generics used?
What is the indent key?
What is command line argument
What is the statements?
Explain thread in java?
Why can't we use static class instead of singleton?
How many classes can any class inherit java?