what is new modifier in C#

Answer Posted / r.r.bharti

It is an error to use both new and override on the same
member, as the two modifiers have mutually exclusive
meanings. Using new creates a new member with the same name
and causes the original member to become hidden, while
override extends the implementation for an inherited member.

Using the new modifier in a declaration that does not hide
an inherited member generates a warning.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is static class not inherited?

817


What is encapsulation with real life example?

784


How is polymorphism achieved?

770


What is the main feature of oop?

895


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1869


Explain virtual inheritance?

887


What is static in oop?

822


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

924


What is overriding vs overloading?

783


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1899


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6708


what is different between oops and c++

2190


What is the point of polymorphism?

767


What is class in oop with example?

829


What is and I oop mean?

831