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 |
What is the auto keyword good for?
What does != Mean in c?
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }
How to add two numbers with using function?
differnce between do and do while
main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?
What are external variables in c?
write a program to print infinte number
Why c is called top down?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is meant by preprocessor in c?
a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above