Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain the Difference between value and reference type.

Answer Posted / suhasini suresh

Reference types are stored on the run-time heap; they may
only be accessed through a reference to that storage. This
allows the garbage collector to track outstanding
references to a particular instance and free the instance
when no references remain. A variable of reference type
always contains a reference to a value of that type or a
null reference. A null reference refers to nothing; it is
invalid to do anything with a null reference except assign
it. Assignment to a variable of a reference type creates a
copy of the reference, not a copy of the value being
referenced.

Value types are stored directly on the stack, either within
an array or within another type. When the location
containing a value type instance is destroyed, the value
type instance is also destroyed. Value types are always
accessed directly; it is not possible to create a reference
to a value type. Prohibiting such a reference makes it
impossible to refer to a value class instance that has been
destroyed. A variable of a value type always contains a
value of that type. Unlike reference types, the value of a
value type cannot be a null reference, nor can it reference
an object of a more derived type. Assignment to a variable
of a value type creates a copy of the value being assigned.

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is misl?

1056


I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the try and dispose blocks is too time-consuming with graphicsobjects. Can I automate this?

1025


What are the new thee features of com+ services, which are not there in com (mts)?

998


What is WSDL? Explain its architecture?

1201


Explain how garbage collection works?

1026


Is atl redundant in the .net world?

1000


What is a strong name in .net?

1054


What is iis? Have you used it?

1030


How viewstate is being formed and how it is stored on client in .net?

1004


Explain when should you use .net web forms over asp.net mvc?

1009


What is DTS and explain the purpose of it?

1085


What is SOAP? How you will do windows and forms authentication?

1178


What is the concept of inheritance in .net?

1172


Explain me what is the difference between a class and an object, and how do these terms relate to each other?

953


What is static constructor, when it will be fired? And what is its use?

1138