Difference between over loading and over ridding?

Answer Posted / manav sharma

Overloading: Same function or operator responds differently
on different types on inputs. This is done by defining a
function (including operator fn() definition) with the same
name but different argument list.

Overriding: Redefining any base class function in a
derieved class to work differently than what is defined in
the base class. So, now the same function called with same
argument list will behave differently when called on the
objects of base and derieved class.

Important: Which instance of function to bind with the
object depends on the type of object on which the function
is called and is decided on compile time. This is also
called early binding or compile time polymorphism.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1645


How Do you Code Composition and Aggregation in C++ ?

24229


What is overloading and its types?

624


What are oops functions?

593


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2772






What is pointer in oop?

543


Templates mean

1592


Prepare me a program for the animation of train

2011


What is encapsulation process?

589


What is encapsulation in oops?

544


What is difference between inheritance and polymorphism?

579


What is polymorphism explain its types?

692


What is use of overloading?

617


which feature are not hold visual basic of oop?

1731


What is the highest level of cohesion?

585