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


Please Help Members By Posting Answers For Below Questions

Describe the ways of cleaning up objects in c#.

677


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

694


What benefit do you get from using a primary interop assembly (pia)?

704


How we convert private assembly into public assembly?

694


Why singleton pattern is used in c#?

682






What are the types of comments in c#?

721


How do I create multifile assembly?

690


Explain About ADO and its objects

746


Is string value type c#?

650


What is selector c#?

662


How do partial classes work in c#?

670


What do you mean by expression tree?

601


Why do we need to call CG.SupressFinalize?

713


Is c# code is managed or unmanaged code?

646


What does get set mean in c#?

661