值类型 (value type),会分配一块内存来存储数据。
引用类型(reference type),不存储数据,而是包含一个指针,指向存储数据的的内存位置。
(A data type is a value type if it holds the data within its own memory allocation. A reference type contains a pointer to another memory location that holds the data.)
值类型包含下列:
值类型 (Reference types) 包含下列:
The following programming elements do not qualify as types, because you cannot specify any of them as a data type for a declared element:
你可以将引用类型或值类型指派给 Object 数据类型的变量。Object 变量总是存储指向数据的指针,从不存储数据本身。然而,如果将值类型指派给 Object 变量,则 Object 变量将表现得像存储自己的数据一样。
(You can assign either a reference type or a value type to a variable of the Object data type. An Object variable always holds a pointer to the data, never the data itself. However, if you assign a value type to an Object variable, it behaves as if it holds its own data. For more information, see Object Data Type.)
通过 Microsoft.VisualBasic 命名空间中 Information 类的 IsReference 方法,可以确定该 Object variable 是用作引用类型还是值类型。如果 Object variable 的内容表示引用类型,则 Information.IsReference 返回 True。
返回上级目录: VB.NET 的参数传递机制 下一页: ByVal (By Value) 和 ByRef (By Reference) 的区别
© 2008 HubaPo.com 版权所有 Contact me