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

How big is an int in c#?

514


What's the difference between system.string and system.text.stringbuilder classes?

529


How to properly clean up excel interop objects?

506


What is array and types of array in c#?

484


Explain “static” keyword in c#?

481






What is semaphore in c#?

514


What are strongly typed objects?

483


What is dll hell, and how does .net solve it?

535


Who is a accessibility modifier “protected internal” available to ?

598


What is sqladapter c#?

532


What are the desktop applications?

469


Is enum a class c#?

502


What is the adv of using System.Text.StringBuilder over System.String?

536


How does dll hell solve in .net?

484


List down the differences between “dispose” and “finalize” methods in c#.

445