Qus:    Explain the differences between value type and reference type.
Nov 05, 2020 05:19 2 Answers Views: 106 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 02: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 08: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 course is right for you?

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


Let`s Connect