VB.NET - Define reference type and value type

Define reference type and value type.

Value type

- If a data type holds the data within its own memory allocation it is of value type.

The different types are as follows:

a. All numeric data types
b. Boolean, Char, and Date
c. All structures, even if their members are reference types
d. Enumerations, since their underlying type is always SByte, Short, Integer, Long, Byte, UShort, UInteger, or ULong
- Every structure is a value type, even if it contains reference type members. For this reason, value types such as Char and Integer are implemented by .NET Framework structures.

Reference Types

- This type contains a pointer to another memory location which holds the data.

The different types are as follows:

a. String
b. All arrays, even if their elements are value types
c. Class types, such as forms
d. Delegates

- A class is a reference type. For this reason, reference types such as Object and String are supported by .NET Framework classes. Note that every array is a reference type, even if its members are value types.
VB.NET - Constructors and destructors
Constructors and destructors - The constructor sets default value to the class and runs when the class is initialized......
VB.NET - What is the use of Command builder?
What is the use of Command builder? - Command builder generates insert/update/delete commands for data adapter based on select command.......
VB.NET - Significance of Import and Using statement
Significance of Import and Using statement - To have same names declared and used in one or more namespaces, import aliases can be used.......
Post your comment