what is reference parameter?
what is out parameters?
what is difference these two?
Answer Posted / lakshmi
When we pass a parameter as ref to a method, the method
refers to the same variable and changes made will affect
the actual variable. even the variable passed as out
parameter is same as ref parameter, but implementation in
c# is different,
Arguement passed as ref parameter must be initialized
before it is passed to the method. But in case of out
parameter it is not necessary. But after a call to a method
as out parameter it is necessary to initialize.
When to use out and ref parameter, out parameter is used
when we want to return more than one value from a method.
| Is This Answer Correct ? | 27 Yes | 2 No |
Post New Answer View All Answers
Define constructor in c#.
What are circular references?
How does bitwise work?
What is ienumerable <> in c#?
What are the return types in c#?
How do I start a program in c#?
What is use of FormBoarderStyle Propertie
What is private void in c#?
Is unboxing an implicit conversion?
What is the console on a mac?
What floating point types is supported in C#?
Is var a data type?
Define a jagged array in c#?
In which way a two-dimensional array declared in C#?
If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.