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.

Answers were Sorted based on User's Feedback



Explain the Difference between value and reference type...

Answer / 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

Explain the Difference between value and reference type...

Answer / kinjal

c# provides a set of datatypes. datatypes of c# contain two categories one is value type and another is reference type.

value type is a variable. datatype value store in variables while a variable of a reference type stores a reference to the data.

both value type and reference type have one common thing - both derived from system.object.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Dot Net General Interview Questions

Using com component in .net?

0 Answers  


Explain .net framework overview?

0 Answers  


What property do you have to set to tell the grid which page to go to when using the Pager object?

2 Answers   Siebel,


when web.config file is being called or referenced?tell me about the searialized procedure followed in page loading.

1 Answers   AZTEC,


can any one tel me hw to connect database connectivity of dot NET and back end as MS access?

1 Answers  


How will u load dynamic assembly? How will create assemblies at run time?

1 Answers  


Is there a way to suppress the finalize process inside the garbage collector forcibly in .net?

0 Answers  


Write a program to create a user control with name and surname as data members and login as method and also the code to call it.

0 Answers  


How Can Registry Editor in .NET?

1 Answers  


Explain the procedure to add assemly to gac to make it shared one?

0 Answers  


What are the different parts of an Assembly in .Net?

1 Answers  


What is Event Bubbling in .NET?

0 Answers   Viscus Infotech,


Categories