Difference between new and override

后端 未结 14 1659
再見小時候
再見小時候 2020-11-22 05:36

Wondering what the difference is between the following:

Case 1: Base Class

public void DoIt();

Case 1: Inherited class

<         


        
14条回答
  •  日久生厌
    2020-11-22 06:09

    If keyword override is used in derive class then its override the parent method.

    If Keyword new is used in derive class then derive method hided by parent method.

提交回复
热议问题