What is the Difference between value and reference type?
Answer Posted / amit kumar
Value Type:
When you assign value to value type variable to
another variable then it's value only copy to another
variable. It allocates memory in stack. Here both variables
work independent.
Reference Type:
When you assign value to reference type variable to
another reference type variable then it's value doesn't
copy both variables are dependent to each other and if you
change one value it reflects in other one. It allocates
memory in the heap data structure.
| Is This Answer Correct ? | 25 Yes | 12 No |
Post New Answer View All Answers
What is Web.config?
Is null in c#?
What is immutable in C#?
What is unmannaged code and will CLR handle this kind of code or not .
What is a verbatim string literal and why do we use it?
What is session c#?
Is string null or empty?
What is the purpose of a constructor in c#?
Can we inherit abstract class in c#?
Explain the role of Garbage collector and its generations?
What is the difference between firstordefault and first?
Which is the best language for desktop application?
How many constructors can a class have c#?
What is executenonquery c#?
Why do we need constructors?