c# - 是什么让类型成为原始类型?
问题描述
有些类型是原始的。我可以看到简单类型中哪些类型是原始类型,哪些不是 MSDN 文档中的定义。
除了在那个列表中之外,原始类型有什么特别之处?
| Type | IsPrimitive | IsValueType |
|----------------|-------------|-------------|
| System.Boolean | True | True |
| System.Byte | True | True |
| System.Char | True | True |
| System.Decimal | False | True |
| System.Double | True | True |
| System.Single | True | True |
| System.Int32 | True | True |
| System.Int64 | True | True |
| System.SByte | True | True |
| System.UInt32 | True | True |
| System.UInt64 | True | True |
| System.UInt16 | True | True |
| System.String | False | False |
| System.Object | False | False |
- 所有原语都是值类型。
- 并非所有简单值类型都是原语。
- 并非所有 CTS 值类型都是原语。
解决方案
推荐阅读
- java - Gradle : : 在 sourceSets 中设置 outputDir 时找不到方法 main()
- javascript - javascript - 如何在查看文档时检测用户正在使用什么浏览器?
- reactjs - 可以在按钮反应中的onClick中调用异步函数吗
- python - Python的数字字典
- reactjs - React 默认值不显示在输入字段中
- laravel - 我使用开放服务器,当我使用 jquery 时,显示错误 500(内部服务器错误)。如何解决?
- r - 如何在 ggplot cumsum plot 的 x 轴上显示刻度标签
- postgresql - 带有 Hikari 的 Spring JPA 未释放连接
- android - 当存在异常对象时解析 json 列表以及使用 Retrofit2
- javascript - while循环测试用例错误