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

Who introduced c#?

499


Is it possible to have different access modifiers on the get/set methods of a property?

519


What is lazy loading and eager loading in c#?

486


Can we use "this" command within a static method?

557


Where are value types stored in c#?

519






Is arraylist generic in c#?

472


What is the difference between namespace and class in c#?

508


What do u mean by delegation?

541


what is main function of alternate teamplate of datalist?

1647


What is the use of 0 in c#?

505


Explain constructor in c#?

686


What is variable and its classification?

530


How to generate strong name key file or which command is used to generated strong name key file?

517


What is the difference between string keyword and system.string class?

517


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

587