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 |
How can you allocate arrays or structures bigger than 64K?
What is structure pointer in c?
If null and 0 are equivalent as null pointer constants, which should I use?
Write a program to print the prime numbers from 1 to 100?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
/*what is the output for the code*/ void main() { int r; r=printf("naveen"); r=printf(); printf("%d",r); getch(); }
What is c language and why we use it?
What is the difference between mpi and openmp?
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
1) int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain the explain the output
Write a code to generate divisors of an integer?
what is the use of getch() function in C program.. difference b/w getch() and getche()??
29 Answers HCL, IBM, Infosys, TCS, Wipro,