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   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net AllOther
 
 


 

 
 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
what is the difference between value types and reference 
types?
 Question Submitted By :: Raghu_113
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the difference between value types and reference types?
Answer
# 1
Value type - bool, byte, decimal, double, enum , float, 
int, long,  short, strut, uint, ulong,
 Value types are stored in the Stack
Reference type - class, delegate, interface, object, string
Reference types are stored in the Heap

Value types : Value types directly contain their data, and 
instances of value types are either allocated on the stack 
or allocated inline in a structure. Value types can be 
built-in (implemented by the runtime), user-defined, or 
enumerations. 

Reference types : Reference types store a reference to the 
value's memory address, and are allocated on the heap. 
Reference types can be self-describing types, pointer 
types, or interface types. The type of a reference type can 
be determined from values of self-describing types. Self-
describing types are further split into arrays and class 
types. The class types are user-defined classes, boxed 
value types, and delegates.

Variables that are value types each have their own copy of 
the data, and therefore operations on one variable do not 
affect other variables. Variables that are reference types 
can refer to the same object; therefore, operations on one 
variable can affect the same object referred to by another 
variable. All types derive from the System.Object base type.
 
Is This Answer Correct ?    2 Yes 1 No
Susant
[Infitech Global]
 
  Re: what is the difference between value types and reference types?
Answer
# 2
Value type-
  1)Direct Contain their data.
  2)Operation on one variable don't effect the other variable
  3)int,short,structure,enum
Reference type-
  1)store the refrence to the data.
  2)operation on one variable can effect the other
  3)Classes,Array,Delegates
 
Is This Answer Correct ?    3 Yes 0 No
Nazrul.nazi
[Usher Infotech]
 
 
 

 
 
 
Other Dot Net AllOther Interview Questions
 
  Question Asked @ Answers
 
1. How to restrict a class from allowing to create only one object. I.e., one should be allowed to create only one object of the class type. 247Customer1
what is the shortcutkey for solution explorer and add new item? Six-Sigma1
what is Difference beetween Array and Hash Table.? Patni5
How can u manage state ? Ness-Technologies1
What is this DLL hell problem in dotnet? Can a virtual class be created/can a virtual method be created inside the class? HCL2
how do u achieve multilevel inheritance in .NET ? Ness-Technologies6
what are clr,cls,cts?what is .net framework? Six-Sigma3
How many types of languages does .net support? name at least 10-15? Six-Sigma7
how do you hide maximize,minimize and close box at the form title bar? Six-Sigma1
how to manage session in webgarden ? Ness-Technologies2
what is the difference between asp and asp.net Six-Sigma1
how to make and display a form without title bar? Six-Sigma1
How to work with Crystal Reports without using Visual Studio?  1
what is web service?  1
Which tool you will use to deploy a windows service Fulcrum-Logic1
what is a tool tip Six-Sigma2
how many types of controls are there in windows and web application? Six-Sigma1
When should you use Abstract Class vs Interface while programming? Give 1 Example T3-Softwares2
What is the difference between SAX Parser and DOM Parser? TCS1
what to choose among testing, .net , and java for a B-Tech (ECE) fresher.  1
 
For more Dot Net AllOther 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