Juxtapose the use of override with new. What is shadowing?
Answer / nawaz
Using override keyword to a method in the derived class
meaning the method provides a new implementation to the
overridden method (same signature) in the base class. The
base method must be virtual, abstract, or override.
By default a method is not modified by ‘virtual’. So if a
method in derived class wants to override the base
implementation, it needs to be modified by ‘new’ keyword.
This is called shadowing, not overriding. The method in the
derived HIDES the one in the base class.
| Is This Answer Correct ? | 3 Yes | 0 No |
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What is the usage of the pointer in c?
#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }
Explain indirection?
How do we open a binary file in Read/Write mode in C?
c program to manipulate x=1+3+5+...+n using recursion
how do we remove the printed character in printf statement and write next it it
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
What is the difference between near, far and huge pointers?
What will happen when freeing memory twice
11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage
How can I handle floating-point exceptions gracefully?