different between overloading and overriding
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?
Which type of language is c?
#include<stdio.h> { printf("Hello"); } how compile time affects when we add additional header file <conio.h>.
What are the salient features of c languages?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Tell me what are bitwise shift operators?
How to implement a packet in C
When can you use a pointer with a function?
write a program that will accept two integers and will implement division without using the division operator if the second value is an odd number and will implement multiplication without using multiplication operator if the second value is an even number.
Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.