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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is difference between value and reference types ?
 Question Submitted By :: Pranab Mukherjee
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is difference between value and reference types ?
Answer
# 1
value types are stored on stack whereas reference types are 
stored on heap memory.
dim i as integer
or
int i

i here ia a value type and will be stored on stack.
Actually nearly all the basic types are implemented as a 
structure.
where as
dim i as new Point()
(assuming point as a class)
i here is a referece variable(pointer) and will be stored 
on stack where as The Point object will be created on heap 
and i will point to it.
 
Is This Answer Correct ?    0 Yes 0 No
Narayansahu
[Netx Softwares Pvt. Ltd.]
 
  Re: What is difference between value and reference types ?
Answer
# 2
value types are stored in the memory.
reference types are stored in the heap.
all implicit datatypes,enums,structs are value types.
delegates,objects are reference types..
pointer to the heap where the data is located is maintained 
in the stack
when we delete a reference type pointer to the heap is 
deleted from the stack
 
Is This Answer Correct ?    1 Yes 0 No
Gowthami
 
 
 
  Re: What is difference between value and reference types ?
Answer
# 3
Value types directly contain their data while reference 
types store a references to variable's value memory
and value types uses stack to store data amd reference 
types use heap to store data
 
Is This Answer Correct ?    0 Yes 0 No
Nitin Kumar Tomar
 
  Re: What is difference between value and reference types ?
Answer
# 4
value refers what is present in the address of the memory
Reference type refers to the address of the memory
Ex:
   int a = 10( here the value stores in the address 'a' and                            the value of that address is 10)
   int b = &a (here the variable b refers the address of 
               the variable a)
here if we print("%d",a) the value prints
here if we print("%d",b) the reference value of a is printed. 
this is the difference between "value" and "reference values"
 
Is This Answer Correct ?    0 Yes 0 No
Thirupathi Reddy
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Visual-Soft3
Explain about throw keyword? HCL7
Why are there five tracing levels in System.Diagnostics.TraceSwitcher?  1
may we achieve polyphormsm through overloading a funtion?Is it right or wrong concept because i read polyphormism can be achieved through overloading?plz help me thnks  1
Where does the dispose method lie and how can it be used to clean up resources? Wipro2
Can you store multiple data types in System.Array?  6
How to run the program at particular time? It should run everyday at 3:00 PM. After executing the program should sleep until next day at 3:00 PM. Please explain with code? Wipro3
what is CLONE() method?  1
can we access main() using objects? ssinformatics1
What is manifest ? Digital-GlobalSoft1
How can you overload a method?  5
can it possible to acees the virthual method using the override method object? plz give me the example  2
How?s the DLL Hell problem solved in .NET? Visual-Soft1
how to retrive a TextBox value in to Sql database using C# windows form application coding  1
Difference between C++ and C#.net TCS13
int a = '3' + '4'; char n = (char)a; What will be answer of n?  3
Explain about Protected and protected internal, ?internal? access-specifier?  6
What?s an abstract class? NIIT2
all information  1
When compiler adds a default constructor to a class? TCS3
 
For more C Sharp 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