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
What are the modifiers available in c programming language?
What is c mainly used for?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
What language is lisp written in?
What is the difference between formatted&unformatted i/o functions?
What is the difference between c &c++?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
In C, What is the #line used for?
What are variables and it what way is it different from constants?
What is the difference between ++a and a++?
Give me the code of in-order recursive and non-recursive.
What is getch() function?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is variable in c example?