Explain the number of ways in which a parameter can be passed to a method ?
Parameters can be passed to a method in following three ways :
- Output Parameters − If the goal is to return more than one value.
- Value Parameters − In This method the actual value of an argument is copied into the formal parameter of the function. If changes are made to the parameter inside the function there is no effect on the argument.
- Reference Parameters − The reference to the memory location of an argument is copied into the formal parameter.Argument is affected by the alterations made to the parameter.
Note: Please Bookmark our website for getting updates on more interview questions like this. If you have any queries related to C#, Asp.net or SQL you can write to us – Click Here