Override an overridden method (C#)

后端 未结 6 903
梦如初夏
梦如初夏 2021-02-03 17:47

I\'m trying to override an overridden method (if that makes sense!) in C#.

I have a scenario similar to the below, but when I have a breakpoint in the SampleMethod() in

6条回答
  •  醉酒成梦
    2021-02-03 18:54

    Overriding can be performed in a chain as long as you like. The code you have shown is correct.

    The only possible explanation for the behaviour you are seeing is that the object to which you are referring is actually of type B. I suggest that you double check this, and if things still don't make sense, post the other appropiate code.

提交回复
热议问题