What is difference between value and reference types?
Answers were Sorted based on User's Feedback
Answer / payal
value
this stored actual value
reference
stored the address of the value
value store in stack
reference is stored in heap
the variable which are value type they each time create
their own copy
the variable which are reference type they refer the same
object every time
| Is This Answer Correct ? | 5 Yes | 1 No |
Value types allocates the values in stack
Reference types allocates the value references in Heap
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / surya
Value Type holds the data within this own memory allocation.
where as Reference Type contains a pointer to another
memory location that holds the data.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / shiva charan
Moreover added to the above points
if two reference variables are pointing to the same
location, change in one reference variable will reflect the
other referenc variable.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Give an example of removing an element from the queue?
Is list ienumerable c#?
what is CSharp
Explain how do you convert a value-type to a reference-type?
When should I use static in C#?
0 Answers SwanSoft Technologies,
What is Signature and parameter in overloading ?
1) how to delete duplicate records from table in sql server 2005 2) what is run time polymorphism
what is webapplication? what is windows application? what is the extension for both . in what purpose we r using webapplication. in which situation we r using windowns application
What is difference between a type and class?
Can Any body send C Sharp latest interview questions to my mail id: alim.mtech@gmail.com.
What Happens In Memory When You Box And Unbox A Value-type?
Why is static constructor called first?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)