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 common language specification (cls)?

1080


What is your observations between vb.net and vc#.net?

1128


What is alias ? Is it used in .Net ?

1105


What is multiThreading in .NET?

1048


Please explain what are an object and a class?

960


What are the purposes of using .net?

1097


What do you mean by web service?

1304


What's the use of system.diagnostics.process class in .net?

1072


Explain can the validation be done in the server side? Or this can be done only in the client side?

932


Explain how to spawn a thread?

953


How many types of transactions are there in com + .net ?

1075


What are Satellite Assemblies? How you will create this? How will you get the different language strings?

2017


What tags do you need to add within the asp:datagrid tags to bind columns manually.

1931


What is il in vb.net?

1027


How we can achieve Connection pooling in .Net?

1097