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 is stack explain?
Difference between nested and inner classes ?
Write a program to show whether a graph is a tree or not using adjacency matrix.
How infinite loop is declared?
What is the generic class?
Why is java multithreaded?
Which package is used for pattern matching with regular expressions?
What is integer valueof?
What is linkedlist in java?
What is a default method?
Write a program to find the whether a number is an Armstrong number or not?
What is functional interface in javatpoint?
How to create an immutable class?
What is a boolean flag in java?
How does hashset work in java?