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 is difference between field and property in c#?

635


How big is a 64 bit integer?

672


is it possible to access a remote web service Without UDDI?

783


Can we change static variable value in c#?

676


Why should I use interface in c#?

723


Why do we write system in c#?

679


What are the Types of JIT and what is econo-JIT

1036


What is a predicate in c#?

687


Can c# inherit multiple classes?

735


What is verbatim literal in c#?

666


What do you mean by thread safe in c#?

651


Is array thread safe c#?

655


Is functional interface runnable?

678


What are extender provider components? Explain how to use an extender provider in the project.

680


What is difference between dynamic and var in c#?

686