What is difference between value and reference types ?

Answer Posted / thirupathi reddy

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 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will the following code compile and run?

562


What does out mean in c#?

509


What is a must for multitasking

573


What does it mean?

568


What is the difference between ienumerable and enumerator?

454






What is boxing & unboxing?

576


What is difference between destructor and finalize?

447


What is the use of system.environment class in c#.net?

529


What are the concepts of dispose method?

499


Can derived classes have greater accessibility than their base types?

551


What are the 3 logical operators?

569


What is a generic in c#?

511


What is type checking in c#?

519


Is it possible to inline assembly or il in c# code?

529


Which .gang of four. Design pattern is shown below?

506