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
Why is ienumerable used?
What is global asax in c#?
Explain nullable types in c#?
What is a dictionary in c#?
Explain the feature of c# language?
Define a jagged array in c#?
What is yield break in c#?
Why do we use readonly in c#?
When a switch is said to be congested?
what is difference between is and as operators in c#?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
Distinguish between the Debug class and Trace class with its functionality?
Does c# replace c++?
What are jump statements in c#?
What is icomparable in c#?