

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Value parameters vs Reference parameters vs Output Parameters in C#
Value parameters
The value parameters copy the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument.
This is the default mechanism for passing parameters to a method. In this mechanism, when a method is called, a new storage location is created for each value parameter.
The values of the actual parameters are copied into them. Hence, the changes made to the parameter inside the method have no effect on the argument.
Reference Parameters
A reference parameter is a reference to a memory location of a variable. When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters. The reference parameters represent the same memory location as the actual parameters that are supplied to the method.
You can declare the reference parameters using the ref keyword.
Output Parameters
A return statement can be used for returning only one value from a function. However, using output parameters, you can return two values from a function. Output parameters are similar to reference parameters, except that they transfer data out of the method rather than into it.
You can declare the output parameters using the out keyword.
- Related Questions & Answers
- How to pass reference parameters PHP?
- How to use Reference Parameters in C++?
- What are default-parameters for function parameters in JavaScript?
- JavaScript Function Parameters
- PHP Context Parameters
- Method Parameters in C#
- Decibel Based Representation of Wireless Communication Parameters - Converting Between the Parameters
- What is the difference between pass by value and reference parameters in C#?
- What is “Parameters without defaults after default parameters in JavaScript”
- Parameters & Arguments in JavaScript.
- Pseudo mandatory parameters in JavaScript
- Optional Parameters in Dart Programming
- How do we pass parameters by reference in a C# method?
- How are parameters passed in C#?
- What are Rest parameters in JavaScript?