ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net General
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
Explain the Difference between value and reference type.
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Explain the Difference between value and reference type.
Answer
# 1
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 ?    3 Yes 2 No
Suhasini Suresh
 
  Re: Explain the Difference between value and reference type.
Answer
# 2
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 ?    0 Yes 0 No
Kinjal
 
 
 

 
 
 
Other Dot Net General Interview Questions
 
  Question Asked @ Answers
 
What are the features of UIP Application Block?  1
for the textbox if i want to allow only numbers.what ever the characters u enter it should not take.which event u used? IBM3
What is the model role in Mvc architecture?  3
How different are interface and abstract class in .Net?  2
What application do you use to install a Windows service?  1
What is the Difference between imperative and interrogative code?  1
What is the managed and unmanaged code in .net? Deltech3
What is exception handling?  1
How will you register com+ services?  1
Where does the dispose method lie and how can it be used to clean up resources? Wipro1
What is meant fulltrust?  1
How can we convert XML data into DataBase table IN .Net? Wipro2
How can you automatically generate interface for the remotable object in .NET with Microsoft tools?  1
What is the standard you use to wrap up a call to a Web service  1
What is WSDL and disco file ? TCS3
What is a strategy pattern? Implement it.  1
What are possible implementations of distributed applications in .NET?  1
Can u any body send the DotNet Interview questions and answers to my mail please....... mindukuru@yahoo.com  1
Where?s Windows service database located?  1
How WSDL is stored ? TCS1
 
For more Dot Net General Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com