个人资料

跳过导航链接首页 > 博客列表 > 博客正文

c#使用new 关键字覆盖基类的属性

:

//如基类字段,初始值0

public static int _start_position = 0;

//则在子类中覆盖该属性的值为100:

public static new int _start_position = 10;

songshizhao
最初发表2023/7/5 0:23:53 最近更新2023/7/5 0:23:53 668
为此篇作品打分
10