Qus:    Explain the differences between value type and reference type.
Nov 05, 2020 11:19 DotNet 2 Answers Views: 1693 ARUNA

 



 Following are the main differences between value type and reference type:

o Value type contain variable while reference type doesn't contain value directly in its memory.

o In reference type, memory is allocated in managed heap and in value type memory allocated in stack.

o Reference type ex-class value type-struct, enumeration

Prev Next
Answers (2)
RITA Nov 06, 2020 08:03
Answer:   Following are the main differences between value type and reference type:
o Value type contain variable while reference type doesn't contain value directly in its memory.
o In reference type, memory is allocated in managed heap and in value type memory allocated in stack.
o Reference type ex-class value type-struct, enumeration

PARTH Nov 10, 2020 14:35
Answer:   1) A Value Type holds the data within its own memory allocation whereas Reference Type contains a pointer to another memory location that holds the real data.
2) Value Type variables are stored in the stack while Reference Type variables are stored in the heap.

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect