What is the difference between the override and new keywords in C#?

后端 未结 5 1173
无人共我
无人共我 2020-11-28 21:49

What is the difference between the override and new keywords in C# when defining methods in class hierarchies?

5条回答
  •  北海茫月
    2020-11-28 22:53

    override lets you override a virtual method in a base class so that you can put a different implementation in. new will hide a non-virtual method in a base class.

提交回复
热议问题