.NET中不可变类型的示例 [英] Examples of Immutable Types in .Net
本文介绍了.NET中不可变类型的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们知道不变性的概念,但是除了
We know the concept of immutability but need to know few immutable types other than
- 字符串
- DateTime
还有更多吗?
推荐答案
以下是框架类库中不可变类型的列表. (随时进行扩展!)
A list of immutable types in the framework class library follows below. (Feel free to expand it!)
- All primitive value types: (Note: not all value types are immutable!)
Byte
andSByte
Int16
andUInt16
Int32
andUInt32
Int64
andUInt64
IntPtr
Single
Double
-
Lookup<TKey, TElement>
这篇关于.NET中不可变类型的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文