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 |
Why is c called c not d or e?
What is variable in c example?
What is scanf () in c?
write a program for 7*8 = 56 ? without using * multiply operator ? output = 56
What is RAM memory? and What is ROM?Who designed one is temparary and another is permanent?why they designed like that?By using far pointer which type data(whether hexadecimal)we can access?
How to add two numbers with using function?
What is macro?
Can true be a variable name in c?
#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }
write a program fibonacci series and palindrome program in c
0 Answers Aditi Placement Service,
what would be the output of the following program main() { int a[] = {1,2,3,4,5}; int *ptr = {a,a+1,a+2,a+3,a+4}; printf("%d %d %d %d",a,*ptr,**ptr,ptr); } }
Differentiate abs() function from fabs() function.