Juxtapose the use of override with new. What is shadowing?
Answer Posted / 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 |
Post New Answer View All Answers
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Process by which one bit pattern in to another by bit wise operation is?
What is the best way to comment out a section of code that contains comments?
Is c# a good language?
What are the advantages and disadvantages of pointers?
List some applications of c programming language?
Why does notstrcat(string, "!");Work?
What is an auto keyword in c?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Explain what are bus errors, memory faults, and core dumps?
Is main an identifier in c?
write a program to create a sparse matrix using dynamic memory allocation.
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
What are the difference between a free-standing and a hosted environment?
Tell me about low level programming languages.