Answer Posted / priya
If you want to pass the value of the variable, use the
ByVal syntax. By passing the value of the variable instead
of a reference to the variable, any changes to the variable
made by code in the subroutine or function will not be
passed back to the main code. This is the default passing
mechanism when you don’t decorate the parameters by using
ByVal or ByRef.
If you want to change the value of the variable in the
subroutine or function and pass the revised value back to
the main code, use the ByRef syntax. This passes the
reference to the variable and allows its value to be
changed and passed back to the main code.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a concrete class in c#?
Why we use get set property in c#?
Why do we use void in c#?
What is the difference between “constant” and “readonly” variables in c#?
What is the difference between early binding and late binding in c#?
Can you pass parameters to destructors?
Why is static constructor called first?
Explain About Virtual functions and their use.
Is a dll an assembly?
What is string concatenation?
What is the difference between “dispose” and “finalize” variables in c#?
What is escape sequence in c#?
Explain the difference between the system.array.copyto() and system.array.clone()?
What is difference between code access and role based security?
What is the diff between the System.Array.CopyTo() and System.Array.Clone()?