Arguments

The code inside a method often needs information passed to it.
You can define this information by adding parameters to the declaration allowing you to pass in arguments.
When a variable is passed to a subroutine or function it is called an argument.
The value used in place of the parameter when we call the method is called the argument.


Passing by Value

The default when you are passing in arguments is by value.

public Method(int Number1) 

Passing by Reference

more details

public Method(ref int Number1) 

Passing Out

more details

public Method(out int Number1) 

Optional / Default

more details

public Method(int Number1 = 10) 

Named Arguments

more details



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext