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

Write a program to find the angle between the hours and minutes in a clock

686


What is ienumerator c#?

651


What is difference between method overriding and method overloading?

728


What is Inheritance in C#?

773


What is a concrete class in c#?

739


Can we instantiate abstract class in c#?

653


Explanation on Generic?

735


Does a class need a constructor c#?

676


How do you type a null character?

658


Explain polymorphism in c# with a simple example?

681


Explain briefly the difference between value type and reference type?

751


Are c# constructors the same as c++ constructors?

715


List some Advantages of switch-case over if else?

674


Define parsing?

672


What is a thread? What is multithreading?

713