摘要: 1、背景与动机 自C#1.0版本以来,我们要定义一个不可变数据类型的基本做法就是:先声明字段为readonly,再声明只包含get访问器的属性。例子如下: struct Point { public int X { get; } public int Y { get; } public Point( 阅读全文
posted @ 2020-11-20 16:06 码客风云 阅读(1623) 评论(0) 推荐(3) 编辑