c# - 什么是整体类型?

标签 c# .net types

研究了switch documentation发现它只能打开整数类型 我开始寻找定义。我到处都找不到。我只能find a list of integral types .

我可以猜测整数类型是集成到语言中的类型,但是我更希望有一个正确的定义。有人有吗?

最佳答案

“整数”指的是整数类型(即整数)。在 C# 中,这意味着 intlongshort 等类型。

请参阅Integral Types Table (C# Reference) :

The following table shows the sizes and ranges of the integral types, which constitute a subset of simple types.

编辑:请记住,switch 语句也支持文字字符串。

关于c# - 什么是整体类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5154104/

相关文章:

C# 通过反射将派生类转换为基类异常

linq - .Net 4.0 中有哪些实现 IQueryable<T> 的可实例化类型可用?

c# - 使用 Linq 遍历层次结构表

c# - 抑制来自动态类型的 RuntimeBinderException 消息

c# - 是否有辅助方法来解析类似 appSettings 的 xml?

c# - 在 c# 中转换通用 SQL 时间格式(所有变体)?

types - 在 Rust 的 32 位机器中,f64 类型是如何表示的?

groovy - 'instanceof' 和 'in' 关键字有什么区别?

c# - 如何获取对象的基础对象(不仅仅是 BaseType)

c# - 从字符串中提取文本