How are parameters passed in C#? Are they passed by reference or by value?

How are parameters passed in C#? Are they passed by reference or by value?

  • Comments 2

By default, all parameters are passed by value in C#. Parameters are only passed by reference if you explicitly include an out or ref modifier. However, you need to be aware that when the type of the parameter is a reference type, you're passing a reference rather than an actual object. For more information, see my article on parameter passing and the C# Programmer's Reference.

[Author: Jon Skeet]

Leave a Comment
  • Please add 3 and 1 and type the answer here:
  • Post
  • A very concise and to the topic answer, thank you.

  • In a very simple language u clear every confusion in this topic..

    Thanks a lot...

Page 1 of 1 (2 items)