Difference between shadowing and overriding in C#?

后端 未结 6 809
面向向阳花
面向向阳花 2020-11-22 07:25

What\'s difference between shadowing and overriding a method in C#?

6条回答
  •  伪装坚强ぢ
    2020-11-22 07:36

    I think the main difference is that with shadowing, you're essentially reusing the name, and just ignoring the superclass use. With overriding, you're changing the implementation, but not the accessibility and signature (e.g. parameter types and return). See http://www.geekinterview.com/question_details/19331 .

提交回复
热议问题