:: 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                      
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)
What is the difference between "overloading" and "overridding"?
 Question Submitted By :: C++-General
I also faced this Question!!     Answer Posted By  
# 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
# 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
Is This Answer Correct ?    4 Yes 0 No
Shakti Singh Khinchi
# 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

Other C++ General Interview Questions
  Question Asked @ Answers
1)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea += sizeof(int); } return 0; } 2)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea ++; } return 0; } The output of this two programs will be different why?   5
What are raw sockets, where they are efficient? Symphony 2
They will ask u question about single linked list?. Write Code for to insert delete node. Persistent 2
what is the diff b/n c and c++ a. dynamic scoping b. nested switching c. declaration of variables in any code block d. separation of compilation and linking Hughes 2
If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number? Persistent 2
How many lines of code you have written for a single program? BoA 4
What is "strstream" ? Huawei 1
What are the differences between a struct and a class in C++? Wipro 6
How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed. Satyam 15
what is the basic concept of c++(object oriented programing) Wipro 4
What is Namespace? Samsung 4
Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);   2
For more C++ General Interview Questions Click Here 

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