|
INTERVIEW QUESTIONS
C++
OPERATOR OVERLOADING IN C++
DETAILS
Question: What is difference between overloading and overriding?
Answer: a) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.<br><br>b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.<br><br>c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass.<br><br>d) Overloading must have different method signatures whereas overriding must have same signature.
|
|
|
Category |
Operator Overloading in C++ Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6582 users |
Added on |
9/19/2014 |
Views |
67680 |
Rate it! |
|
|
Question:
What is difference between overloading and overriding?
Answer:
a) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.<br><br>b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.<br><br>c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass.<br><br>d) Overloading must have different method signatures whereas overriding must have same signature. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the difference between shadow and override?
|
View Answer
|
|
What methods can be overridden in Java?
|
View Answer
|
|
In C++, what is the difference between method overloading and method overriding?
|
View Answer
|
|
You’re given a simple code for the class Bank Customer. Write the following functions: * Copy constructor * = operator overload * == operator overload * + operator overload (customers’ balances should be added up, as an example of joint account between husband and wife)
|
View Answer
|
|
What is the difference between "overloading" and "overriding"?
|
- Operator Overloading in C++ Interview Questions & Answers">
View Answer
|
|
What is the need /use of function overloading
|
View Answer
|
|
What is operator overloading?what r the advantages of operator overloading?
|
View Answer
|
|
Can destructor be private?
|
View Answer
|
|
Can main() be overridden?
|
View Answer
|
|
What is function overriding?
|
View Answer
|
|
What is the difference between an interface and abstract class?
|
View Answer
|
|
What is function overloading and operator overloading?
|
View Answer
|
|
What is virtual constructors/destructors?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Operator Overloading in C++ Interview Questions & Answers - Exam Mode /
Learning Mode
|