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


Please Help Members By Posting Answers For Below Questions

Which programming language is best for getting job 2020?

602


What is the difference between procedural and functional programming?

512


What is the general form of function in c?

607


What is a null string in c?

579


What language is lisp written in?

609






What are the preprocessor categories?

633


I have seen function declarations that look like this

593


What is #include stdio h and #include conio h?

592


How to explain the final year project as a fresher please answer with sample project

463


what is bit rate & baud rate? plz give wave forms

1512


hi, which software companys will take,if d candidate's % is jst 55%?

1654


number of times a digit is present in a number

1537


What is the difference between constant pointer and constant variable?

742


What does %p mean c?

621


Explain about the functions strcat() and strcmp()?

596