gpt4 book ai didi

c# - C# 中类初始值设定项之间的区别?

转载 作者:太空狗 更新时间:2023-10-29 20:03:36 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Why are C# 3.0 object initializer constructor parentheses optional?

使用实例化对象有什么区别

classInstance = new Class() { prop1 = "", prop2 = ""};

classInstance = new Class { prop1 = "", prop2 = ""};

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