ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C++ >> C++ General
 
 


 

 
 STL interview questions  STL Interview Questions (91)
 OOPS interview questions  OOPS Interview Questions (558)
 C++ General interview questions  C++ General Interview Questions (458)
Question
What is the difference between "overloading" and "overridding"?
 Question Submitted By :: C++-General
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
overloading means that we can use same method with same
name many times for multiple purpose in a class with
difference parameters.

overriding means we can refer a method of a base class with
same name in a derived class with same paameters.
 
Is This Answer Correct ?    8 Yes 0 No
Shivanannd
 
Answer
# 2
Overloading: When more then 1 methods in a class having same
name but they are different in their number of parameters,
different in their parameters types and their order.

Overriding: When a parent class is derived by a child class
and some method which has present in parent class which is
declared as "virtual" in parent class , same method with
same name and parameters and sam type is also declared in
child class without "virtual" keyword, bcz it is by default
virtual in child. SO PARENT AND CHILD CLASS USES SAME METHOD
ARE CALLED OVERRIDING.
 
Is This Answer Correct ?    4 Yes 0 No
Shakti Singh Khinchi
 
 
 
Answer
# 3
Overloading uses same funtion with different parameters

Overriding Uses same exactly similar funtion prototypes
this used in runtime polimorphism ie Virtual Funtions
 
Is This Answer Correct ?    2 Yes 0 No
Vighnesh
 

 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
When is a template better solution than a base class?? emc2 2
how is returning structurs from functions?Show an eg? GE 1
string somestring ; Which of the following choices will convert a standard C++ string object "somestring" to a C string? a) Copy.somestring () ; b) somestring.c_str () c) &somestring [1] d) std::cstring (somestring) e) (char *) somestring Quark 1
You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.   4
What is Pure Virtual Function? Why and when it is used ? Lucent 9
structure that describe a hotel with name, address,rooms and number of rooms   2
What is conversion constructor? TCS 2
plz send me National informatics center paper pattern   1
Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible. Microsoft 4
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.   3
what is the C++ Wipro 1
What is the difference between reference type and pointers. HCL 4
 
For more C++ General Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com