c# - 将参数传递给 C# 8 中的类声明
问题描述
从 C# 8 开始,我们可以执行以下操作:
public class MyClass(int a)
{
// note, this is NOT the constructor, but the class declaration
}
这是如何运作的?
在 C#7 中,它被标记为实验性功能;但我找不到有关它的文档。是否仍被认为是 C# 8 的实验性版本?
我看到了这个:
解决方案
推荐阅读
- ubuntu - ACR122 NFC 阅读器不适用于 libnfc ubuntu
- time-series - DynamoDB 对时间序列数据有好处吗?(市场股票价格示例)
- excel - 如何使用 VBA 自动点击 URL?
- javascript - Rails 加载 js 不一致
- php - url 和 youtube 嵌入、vimeo 和图像的文本替换
- vb.net - VB.Net登录表单无法连接到Access数据库
- rust - 如何从数组值创建实例
- java - 同步动画的最佳方式
- java - 如何在方法中使用带有“回退”参数的接口?
- gradle - 如何在插件应用中使用 gradle 插件配置?