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
What is the purpose of the integer parse method the decimal parse method?
What are custom exceptions? Why do we need them?
What is the difference between virtual and override in c#?
What is the namespace for datatable in c#?
Is comparator a functional interface?
Why do we use static methods in c#?
What is func c#?
How do I run a cshtml file?
How does split work in c#?
What is concrete class in c# with example?
Explanation on Generic?
Can abstract class have private constructor c#?
What are bitwise logical operators?
Explain more on CLR
Define delegate in c#?