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 c sharp language?

686


What is ienumerator c#?

636


Distinguish between continue and break statement?

727


What is an xsd file?

674


What is the difference between const and static read-only?

665






What is sqldatareader c#?

648


3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close

1604


Explain the difference between a struct and a class?

671


What is a concrete class in c#?

725


Can private virtual methods be overridden in c#.net?

687


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

788


What is lazy in c#?

657


Why c# is called type safe language?

619


Does c# have primitives?

624


What is yield c#?

640