adspace


What is difference between value and reference types ?

Answer Posted / narayansahu

value types are stored on stack whereas reference types are
stored on heap memory.
dim i as integer
or
int i

i here ia a value type and will be stored on stack.
Actually nearly all the basic types are implemented as a
structure.
where as
dim i as new Point()
(assuming point as a class)
i here is a referece variable(pointer) and will be stored
on stack where as The Point object will be created on heap
and i will point to it.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to assign Null value to Var?

1064


What is an abstract class c#?

969


Which namespaces are necessary to create a localized application?

1142


What is expression tree in c#?

998


Why can't we use a static class instead of singleton?

954


How do you inherit a class into other class in c#?

995