different between overloading and overriding

Answers were Sorted based on User's Feedback



different between overloading and overriding..

Answer / rekha

Overriding - same method names with same arguments and same
return types associated in a class and its subclass.

Overloading - same method name with different arguments, may
or may not be same return type written in the same class itself.

Is This Answer Correct ?    6 Yes 0 No

different between overloading and overriding..

Answer / pugalarasu

Overloading:
Same function name but different arguments
Eg:
A(int i);
A(int i,float f);

Overriding:
refers to functions that have the same signature as a
virtual function in the base class:
class B {
virtual void V();
};

class D : public B {
viod V();
};

Is This Answer Correct ?    3 Yes 1 No

different between overloading and overriding..

Answer / rakurakesh

Method overloading
done in same
class but method overridng done in
diff. Class here inheritance occure.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort

7 Answers  


How does placing some code lines between the comment symbol help in debugging the code?

0 Answers  


what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }

1 Answers   Google,


What is data structure in c and its types?

0 Answers  


const char * char * const What is the differnce between the above tow?.

6 Answers   Ramco, TCS,






Where we use clrscr in c?

0 Answers  


what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.

6 Answers   HCL,


what is a function pointer and how all to declare ,define and implement it ???

4 Answers   Honeywell,


difference between c and c++?

2 Answers  


What does static mean in c?

1 Answers  


Can a function argument have default value?

0 Answers   Genpact,


inline function is there in c language?

4 Answers  


Categories