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


Please Help Members By Posting Answers For Below Questions

What is a static property. Give an example?

522


What is difference between write and writeline?

468


What is satellite assembly? And steps to create satellite assembly?

519


What does the keyword “virtual” declare for a method or property?

542


explain the features of static/shared classes.

503






What is the difference between icomparer and icomparable in c#?

469


What is the keyword used to prevent a class from being inherited by another class?

670


What is visual c# net?

496


What is the do while loop code?

491


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

545


What is the difference between abstract and virtual?

447


Explain About remoting and web services. Difference between them

546


What is better C# or VB.NET?

532


What is generic method in c#?

496


How to use reflection to call generic method?

502