
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What is the difference between pass by value and reference parameters in C#?
Reference Parameters
A reference parameter is a reference to a memory location of a variable. The reference parameters represent the same memory location as the actual parameters that are supplied to the method.
When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters.
Pass by Value
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.
- Related Articles
- Differences between pass by value and pass by reference in C++
- What is Pass By Reference and Pass By Value in PHP?
- Which one is better in between pass by value or pass by reference in C++?
- Is java pass by reference or pass by value?
- Describe pass by value and pass by reference in JavaScript?
- How do we pass parameters by reference in a C# method?
- What is pass by reference in C language?
- Pass by reference vs Pass by Value in java
- Is JavaScript a pass-by-reference or pass-by-value language?
- Value parameters vs Reference parameters vs Output Parameters in C#
- How to pass reference parameters PHP?
- Pass by reference vs value in Python
- Difference between Call by Value and Call by Reference
- How do we pass parameters by value in a C# method?
- What is pass by value in C language?

Advertisements