In .NET, which of the following is NOT a value type?
- double
- char
- int
- string
EXPLANATION
Main features of value types
A variable of a value type contains a value of the type. For example, a variable of the
When you assign a new value to a variable of a value type, that value is copied. When you assign a new value to a variable of a reference type, the reference is copied, not the object itself.
int
type might contain the value 42
.
This differs from a variable of a reference type, which contains a
reference to an instance of the type, also known as an object.
When you assign a new value to a variable of a value type, that value is copied. When you assign a new value to a variable of a reference type, the reference is copied, not the object itself.
Source
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value-types
0 comments:
Post a Comment