using 'new'. Do I have this right?

R

relient

Putting Polymorphism aside. In a situation where a non-virtual method
in a base class is hiden in a derived class by declaring a method with
the same signature as in the base, you only have the option of using
the 'new' keyword but not the override keyword. Correct? That said,
explicitly marking the method with 'new' or not will result in the same
thing. Correct? But by explicitly marking it with 'new' your code
becomes self-documented to other programmers of your intention to
provide a different interpretation and implementation of the method. So
in this situation (where no polymorphism is involved); that's the
*only* use of the 'new' keyword. Correct?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top