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

What will be the output of the following code?

514


What are the commonly used i/o classes?

531


What is the role of the datareader class in ado.net connections?

513


What is a method c#?

478


Difference between debug.write and trace.write?

522






Explain how to use an extender provider in the project.

490


How do I start a program in c#?

493


What is extended class in c#?

476


What are the steps for creating clr trigger

569


Define delay signing?

534


What is unmannaged code and will CLR handle this kind of code or not .

593


What does args mean in c#?

498


What's the implicit name of the parameter that gets passed into the set method/property of a class?

592


what is an event? Define delegate?

532


If casting fails what type of exception is thrown?

484