I. in C #, the keyword "new" is frequently used and has three main functions:
A) is used as an operator to create an object and call constructor.
B) as modifier.
C) used to constrain the types of parameters that may be used as type parameters in generic declarations.
In this article, we will only introduce the function of new as a modifier. When used as a modifier, The new Keyword can hide the method of the base class in the derived class, that is to say, the method used in the derived class is to call the method with the New keyword.New definitionInstead of the base class method. If you do not use the New keyword to hide the base class method, the compiler will receive a warning prompting you to use the New keyword to hide the base class method.
Note that the New and Override keywords are mutually exclusive. It cannot be used at the same time.
II. The main keyword of Override isProvides a new implementation of the derived class to the base class method.The Override base class method must be the same as the Override method.Same signatureThis keyword cannot be used to Override non-Virtual and static methods. The keywords used with this keyword are Virtual, abstract, and Override. At the same time, the Override method cannot modify the accessibility of the Virtual method. The Override method and the Virtual method must have the same access modifier, you cannot use modifiers new, static, virtual, or abstract to modify the override method.