“new” keyword in property declaration in c#

前端 未结 5 1432
忘掉有多难
忘掉有多难 2020-12-01 15:26

I\'ve been given a .net project to maintain. I was just browsing through the code and I noticed this on a property declaration:

public new string navUrl
{
           


        
5条回答
  •  时光取名叫无心
    2020-12-01 16:16

    https://msdn.microsoft.com/en-us/library/435f1dw2.aspx

    Look at the first example here, it gives a pretty good idea of how the new keyword can be used to mask base class variables

提交回复
热议问题