What is the Difference between value and reference type?

Answers were Sorted based on User's Feedback



What is the Difference between value and reference type?..

Answer / nithya

value type variable :
If the valuetype variable data is copied to another
variable, its actual data is not effected.
eg., for valuetype variables are
char,boolean,structures,enumerations .
eg.
dim m.n as integer
m=100
n=200

reference type variable:
variable doesnt stores the actual data, instead it has a
pointer . that pointer will points to the actual data
location
eg., for reference type variabls are array,class .
eg.
dim a,b as integer
a=5
assume, a is in the memory locatyion of 1001.
that address value will be stored to the another variable
say b whose address is 1020

Is This Answer Correct ?    6 Yes 9 No

What is the Difference between value and reference type?..

Answer / ramu

watras

Is This Answer Correct ?    1 Yes 27 No

Post New Answer

More C Sharp Interview Questions

What is string pool in c#?

0 Answers  


Can you mark static constructor with access modifiers?

0 Answers  


Can abstract class instantiated c#?

0 Answers  


What is the difference between func and action delegate?

0 Answers  


Which is faster hashtable or dictionary?

0 Answers  






Define boxing and unboxing in c#?

0 Answers  


Which of these statements correctly declares a two-dimensional array in c#?

0 Answers  


Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two methods public virtual SomeMethodA public virtual SomemoreMethodA B:A overide SomeMethodA C:B new Method SomeMethodA override SomeMoreMethodA main method { b new instance of B b.SomeMethodA b.SomeMoreMethodA b1 new instance of C b1.SomeMethodA b1.SomeMoreMethodA }

2 Answers   Proteans,


Why do we need interfaces?

2 Answers   HCL,


What is written in c#?

0 Answers  


what is a constructor?

5 Answers   Amazon, Amdocs, Choice Solutions,


Why do we need abstract class?

0 Answers  


Categories