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 memory allocated by the following definition ? int (*x)[10];
How do I convert a string to all upper or lower case?
When should structures be passed by values or by references?
What is static memory allocation?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Can a binary search tree be used as an index? If yes, how? Explain
What do you understand by friend-functions? How are they used?
swap 2 numbers without using third variable?
How can I automatically locate a programs configuration files in the same directory as the executable?
What is a loop?
can anyone suggest some site name..where i can get some good data structure puzzles???
Function shall sum members of given one-dimensional array. However, it should sum only members whose number of ones in the binary representation is higher than defined threshold (e.g. if the threshold is 4, number 255 will be counted and 15 will not) - The array length is arbitrary - output the results to the stdout