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
Explain about CTS?
What do you understand by 'access specifiers' in C#?
What is the lock statement in c#?
Why is c# better than java?
What do you understand by the terms datareader object and dataset object?
What can I create with c#?
What is the difference between a method and a property?
Can int be null c#?
What is the use of console readkey ()?
What is static class in C#?
What is void method?
Is c# good for beginners?
Explain the difference between access specifier and access modifier in c#?
Is c# and c sharp same?
What is string empty?