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
What is different between Boxing and Unboxing?
What is an inheritance ?Give an example in which inheritance is used?
Can an int be negative c#?
Explain the use of virtual, sealed, override, and abstract method?
What is data annotation in c#?
Explain the difference between Response.Write () and Response.Output.Write ().
Explain the types of assemblies in .net?
Why c# is called c sharp?
Any problem found in vs.et
How do you read an Excel sheet in C#?
What is the use of table aliases?
Are tuples immutable c#?
Difference between StackPanel and RelativePanel ?
Explain About .NET Framework
How many dimensions can an array have?