What is value type and reference type?

Answers were Sorted based on User's Feedback



What is value type and reference type?..

Answer / usman

In simple words value types are those datatypes that store
there values on stack memory and values are settle down at
compile time example are "ENUM" and reference type are
those datatype that store there values in heap memory and
settle down while run time i.e dynamic types examples are
strings,class type etc

Cheers

Is This Answer Correct ?    10 Yes 1 No

What is value type and reference type?..

Answer / kishore

Value types are the variables that directly contain the
vaiue and are stored in stack memry.
Example: int, char, float...

Reference types does not contain the value directly but has
the address of the value i.e reference address..
Reference types are stored in Heap memory.

Is This Answer Correct ?    1 Yes 1 No

What is value type and reference type?..

Answer / sushma

value types store values,even if we copy that the orginal
one it is uneffected,even if we modify the copied one ,
the reference types stores refereneces of the object, if
copy that one ,it is effected,if we modify the copied one

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Structs are largely redundant in c++. Why does c# have them?

1 Answers  


What is private variable?

1 Answers  


What is an object and a class?

1 Answers  


How does foreach loop work in c#?

1 Answers  


explain the features of static/shared classes.

1 Answers  


What are the Types of compatabilities and explain them

1 Answers   DELL,


What is a trace and asset? Explain some differences?

1 Answers   Accenture,


What is int32 in c#?

1 Answers  


Illustrate race condition?

1 Answers  


What is the difference between finalize() and dispose() methods?

1 Answers  


What are managed providers?

1 Answers   UGC Corporation,


Define collections?

1 Answers  


Categories