Override

An override method indicates that this class provides a new implementation of a method inherited from the base class.
This overridden method must have exactly the same signature as the base method.


Applies to methods, properties, events, indexers
An override method indicates that it is providing a new implementation for a member in the derived class
The base class member must be virtual, abstract or override
The method must have exactly the same signature.

public class Base 
{
   public virtual void Method() {}
}

public class Derived : Base
{
   public override void Method() {}
}

Cannot be used with 'static'




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext