Diffrernce Between Overloading and Overriding?
Answers were Sorted based on User's Feedback
Answer / anupam mittal
In overloading all the function have same name but
different in no. of argument, type of argument and oreder
of argurmnt while in case of overriding both function are
defined in differenet class when a function inherit from
parent class and there is a function with same prototype in
child class then child class function override the parent
class funciton.
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / sourisengupta
OverLoading :- Method Name remains the same with different
signatures.
For ex:- Take a method name vehicle.
if u are passing two parameters to it , it will generate
informations for 2 wheelers .
if u are passing four parameters to it, it will generate
informations for 4 wheelers.
shortly we can tell same with different characteristics.
Overriding : - Method name and signatures must be same.
In overriding user can change the behaviour of the method
for the derived class.
| Is This Answer Correct ? | 3 Yes | 0 No |
If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2. please answer my question ....
give me the defination of inheritance?
What is stl in oop?
What is Object Oriental Progam
Is there any error below, its a code to delete all entires from a map #include <map> #include iostream.h int main() { int i =0; map <int, char> TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map<int, char> :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
how to overload << and >> operator in c++
Difference between Structure and Class in C++?
Write a program in C++ returning starting locations of a substring using pointers
what's the difference between function overloading and function overiding?
how to swap two numbers in a linked list without exchanging the data but only the links?
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.