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
What are the differences between a class and a struct?
Why do we need delegates?
What is the use of readkey in c#?
What is written in c#?
What is the difference between icomparer and icomparable in c#?
Write down the c# syntax to catch an exception
What is difference between constants and read-only?
How does c# achieve polymorphism?
Explain partial class in c#?
What is the difference between console application and windows application?
What is _viewstart cshtml?
What is using directive in c#?
What is threading in c# with example?
Which control cannot be placed in mdi?
Explain about Error handling and how this is done