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 a static property. Give an example?
What is difference between write and writeline?
What is satellite assembly? And steps to create satellite assembly?
What does the keyword “virtual†declare for a method or property?
explain the features of static/shared classes.
What is the difference between icomparer and icomparable in c#?
What is the keyword used to prevent a class from being inherited by another class?
What is visual c# net?
What is the do while loop code?
Why do I get an error (cs1006) when trying to declare a method without specifying a return type?
What is the difference between abstract and virtual?
Explain About remoting and web services. Difference between them
What is better C# or VB.NET?
What is generic method in c#?
How to use reflection to call generic method?