What are the two keywords used to pass a variable by
reference in c#?

Answer Posted / pramod singh

A variable of a reference type does not contain its data
directly; it contains a reference to its data. When you pass
a reference-type parameter by value, it is possible to
change the data pointed to by the reference, such as the
value of a class member. You cannot change the value of the
reference itself; that is, you cannot use the same reference
to allocate memory for a new class and have it persist
outside the block. To do that, pass the parameter using the
ref (or out) keyword. For simplicity, the following examples
use ref.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What to implement on my class Finalize or IDisposable

769


What do multicast delegates mean?

737


What are partial types in c#?

680


What is default constructor c#?

759


What does console mean c#?

708


What is delegates and events?

686


What is ienumerable and iqueryable?

724


Can int be null c#?

719


Why are local variables stored in stack?

804


Can we inherit static class in c#?

719


Explain the access modifiers in c#?

703


Is arraylist type safe in c#?

733


Is null in c#?

675


What does question mark mean in c#?

796


What is the purpose of namespace in c#?

661