What is the Difference between value and reference type?
Answer Posted / amit kumar
Value Type:
When you assign value to value type variable to
another variable then it's value only copy to another
variable. It allocates memory in stack. Here both variables
work independent.
Reference Type:
When you assign value to reference type variable to
another reference type variable then it's value doesn't
copy both variables are dependent to each other and if you
change one value it reflects in other one. It allocates
memory in the heap data structure.
| Is This Answer Correct ? | 25 Yes | 12 No |
Post New Answer View All Answers
Can you inherit multiple classes in c#?
What is binary search tree in data structure?
Are c# strings immutable?
What are the benefits of using generics?
What do you mean by a windows process in regards to memory allocation?
What is generic method in c#?
What is the function of .IsDescendent()?
Between windows authentication and sql server authentication, which one is trusted and which one is untrusted?
Is stringbuilder better than string?
How is exception handling implemented in c#?
What is type checking in c#?
Is it possible to have a static indexer in c#? Allowed in c#.
What is arraylist?
Can you create partial delegates and enumerations?
What is the difference between list and arraylist in c#?