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 |
Why is c faster?
Why is c called "mother" language?
Write a function that will take in a phone number and output all possible alphabetical combinations
What is c definition?
What is the scope of global variable in c?
How do you define CONSTANT in C?
Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates
What are identifiers and keywords in c?
How do we print only part of a string in c?
how to implement stack work as a queue?
What is the output of the program #include<stdio.h> #include<conio.h> void main() {0 int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); }
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,