What is the Difference between value and reference type?

Answer Posted / ajay

whenever a datatype is defined based on a structure it is said to be value type datatype.
whenever a datatype is derived from class definition then it is said to be reference type datatype.

value type memory allocated in stack
reference type memory allocated in heap

Inheritance is not support by the Value type members
Inheritance is support by the Reference type members

Value type data type are byte,int,uint,float,Double,decimal,char and bool
Reference type data type are string,class,objects,Enwn,interface and delegates

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a collection in c#?

503


How can I produce an assembly?

581


Is static class thread safe in c#?

466


Can properties be private in c#?

472


What is the difference between select and selectmany?

430






Differentiate between static class and singleton instance?

515


Can partial class be inherited?

493


What are bitwise logical operators?

477


What happens if you add duplicate elements to a set?

500


Explain the difference between private and shared assembly?

455


What is func delegate in c#?

501


What is lock statement in C#?

547


Is c# pass by value?

483


How to add controls dynamically to the form using c#.net.

469


Why reflection is used in c#?

489