What is difference between value and reference types?

Answer Posted / kartheeksirangipatel

ValueType:
-->Value types holds data directly.
-->Nodefault value for valuetype
-->valuetype stored in stack memory
-->Stack is not accessible to Garbage collector
Ex--->Predefined datatypes
Structures
Enumarator
Reference type:
-->Ref type does not holds the datadirectly
-->Ref type holds the default value
-->ref type will be stored in Heap memory
-->Heap is accessible to garbage collector
Ex--->Arryas
Classes
Objects
Deligates
Interfaces

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is stringbuilder thread safe c#?

476


What is the root element of an xml file?

494


What is the difference between CONST and READONLY?

569


What is the use of console readkey ()?

474


What is the difference between class and namespace?

488






What does ienumerable mean?

478


What is the difference between readkey and readline in c#?

450


What is dataadapter c#?

478


What is difference between the "throw" and "throw ex" in .net?

486


How would you describe encapsulation in c#?

482


Can I fly with a loop recorder?

475


What is the task perform by clr?

570


what is the default access for a class

576


what are the differences between a class and structure

538


Is system a class in c#?

487