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

Explain copy constructor?

864


How big is a float?

682


What are the Types of caching

741


How does aspect oriented programming work?

714


How to use exception handling in stored procedure?

740


When should I use static in C#?

725


How many constructors can a class have in c#?

664


Why do we use classes?

651


What is sorting in c#?

671


What is the difference between list and ilist in c#?

640


What is the use of oops in c#?

675


What is the default value of decimal in c#?

673


What is Delegate and what is it used for ?

760


How can we set the class to be inherited, but prevent the method from being over-ridden?

664


What is asp net c# corner?

1003