gpt4 book ai didi

c# - 何时以及为何在 C# 中使用别名或其类名?

转载 作者:太空宇宙 更新时间:2023-11-03 18:53:47 25 4
gpt4 key购买 nike

我们为什么以及什么时候应该使用 intint16int32int64doublestring 而不是 IntInt16Int32Int64Double, String 分别是?我已经准备了很多关于这个的文章,但仍然没有找到合适的解决方案。

最佳答案

这纯粹是偏好/传统问题。

C# language specification状态:

Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32. As a matter of style, use of the keyword is favoured over use of the complete system type name.

关于c# - 何时以及为何在 C# 中使用别名或其类名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50540049/

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