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

What is sqlcommandbuilder c#?

449


How many digits are in an integer?

471


What is the difference between integer and double?

463


What is the difference between a class and an object c#?

470


Can we customize the serialization process?

522






what is the index value of the first element in an array?

508


What is dataset c#?

488


What does ienumerable mean?

476


What does mean before a string in c#?

512


Is php better than c#?

493


Differentiate between response.expires and response.expiresabsolute?

539


Explain states of a thread in c#?

522


How to use delegates with events?

546


What is overriding in c#?

492


Distinguish between system.string and system.text.stringbuilder classes?

436