gpt4 book ai didi

c# - 为自动实现的属性设置默认值

转载 作者:太空狗 更新时间:2023-10-29 21:05:01 24 4
gpt4 key购买 nike

<分区>

假设我有一个自动实现的属性

public int SheetNum { get; set; }

有没有把 SheetNum 的默认值设置为 1,这样就可以了

private int sheetNum = 1;

public int SheetNum
{
set { this.sheetNum = value; }
get { return this.sheetNum; }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com