What is the difference between overloading and overriding a
function?
Answer Posted / ghanshyam dobariya
OVERLOADING: Declaration and definition are in the same
class i.e. a class in which they are defined.
OVERRIDING:Declaration is done at super class while actual
definition is define in sub class.
OVERLOADING: Any code mistake we make in defining it's code
, detected at compile time
OVERRIDING: Any code mistake we make in defining it's code
,detected at run time.
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What exactly is java?
How are multiple inheritances done in Java?
what is the constructor and how many types of constructors are used in java?
What are methods of a class?
What is the purpose of main function in java?
Why is flag used in java?
If a variable is declared as private, where may the variable be accessed?
How will you reverse a link list without using recursion?
What is the difference between break and continue statements?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
Can list be final in java?
What is java reflection?
Can you make a constructor final?
What is ++ a in java?
Can java arraylist hold different types?