Hiding vs. Overriding a Method
Learn to create a new method with the same signature.
We'll cover the following
Hide
Hiding creates a method of the same name and signature as it it’s defined in the base class. To hide a method, we use the new
keyword:
public new void Voice()
{
}
Instead of providing a method with a different implementation (overriding), the new
keyword creates an entirely different method, but with the same name and signature. A method marked with the new
keyword isn’t associated by any means with the base version of the method. They’re completely separate entities.
Get hands-on with 1400+ tech skills courses.