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
What is difference between field and property in c#?
How big is a 64 bit integer?
is it possible to access a remote web service Without UDDI?
Can we change static variable value in c#?
Why should I use interface in c#?
Why do we write system in c#?
What are the Types of JIT and what is econo-JIT
What is a predicate in c#?
Can c# inherit multiple classes?
What is verbatim literal in c#?
What do you mean by thread safe in c#?
Is array thread safe c#?
Is functional interface runnable?
What are extender provider components? Explain how to use an extender provider in the project.
What is difference between dynamic and var in c#?