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
If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?
How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?
Define c# delegate?
What is the difference between dll and lib?
Is dictionary reference type c#?
Why do we need to serialize data?
What is the implicit name of the parameter that gets passed into the class set method?
What is the difference between new and override in c#?
Does c# provide copy constructor?
What is console based application?
What is type checking in c#?
Is null or empty in c#?
What is the difference between abstraction and encapsulation in c#?
How do I move from one form to another in c#?
What is a datacontract?