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

What's the c# syntax to catch any possible exception?

488


What is the difference between a function and a method?

503


Explain the accessibility modifier protected internal?

460


What is Inheritance in C#?

571


What is the syntax for calling an overloaded constructor within a constructor?

535






Can an int be negative c#?

581


What is the difference between and xml documentation tag?

519


Difference between value and reference type.

509


What is int32 in c#?

497


What is the difference while using directive vs using statement ?

514


What is ac callback?

502


explain Garbage collector’s functionality on unmanaged code

514


What are custom exceptions? Why do we need them?

523


What is wpf c#?

489


Can arraylist store different data types in c#?

470