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 ienumerable t in c#?

488


What is the full form of GAC? Explain its uses?

578


What is a byte in c#?

555


What is an xsd file?

507


For read-only operation which property you have to designated?

557






What are strongly typed objects?

483


What is the difference between firstordefault and singleordefault?

482


What is a ienumerator?

499


Define an escape sequence, name few strings in escape sequence?

479


What does a constructor do c#?

498


Why linq is having select clause at the end?

535


Is dll a library?

491


What is an example of a delegate?

510


What is the difference between namespace and class?

437


What are the access modifiers in c#?

499