What is "out" parameter how it is used in methods?
Answers were Sorted based on User's Feedback
Answer / bharani
A out parameter is a parameter option to pass value to the
calling function. If a function needs to return multiple
values to the calling function the it is best to use out
parameter whereas return parameter can be used for
returning only one value.
An out parameter should be marked with an out keyword, and
the parameter should be initialized inside the function.
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / somnath nanekar
if we want something from that method/procedure to return
then use out parameter
1st we call that method with out parameter. then give some
value to that out parameter in procedure and then use that
value...
so to get the required value we use out parameter
| Is This Answer Correct ? | 11 Yes | 3 No |
Answer / sendhil vel
methods cannot have out parameters only parameters with ref
or value can be passed to method/function
When we talk about procedures in Sql server we can have out
parameters. They are mainly used when you want to return
multiple values and non numeric values from the sql
procedures
They are usefull when you are calling a procedure from
another procedure and need some specfic values
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / bhavnasweet04
Out Parameter: Used to pass a parameter as a reference so
that the function called will set the value. This could be
used to return more than 1 value by a function.
e.g.
public int AddMuliply( int a int b out int c)
{
c a*b;
return ( a+b);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sai ranganath
out parameter option to pass value to the
calling function. for array it can used in a flexible way...
out can be used as calling function in methods
| Is This Answer Correct ? | 2 Yes | 2 No |
What is Jit compilers?.how many are available in clr
Can a view be shared across multiple controllers? If yes, how we can do that?
How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?
Why is the .net framework 3.0 a major version number of the .net framework if it uses the .net framework 2.0 runtime and compiler?
Can Static Constructor be Overloaded?Justify it?
Can we have enum in entity framework?
What is meant by tempdata in mvc?
What is object service? : Entity framework
What are scaffold templates in mvc?
What are the components required to create a route in ASP.Net MVC?
Can we have more than 1 partial classes in the same file?
How many .NET languages can a single .NET DLL contain