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
public Method(ref int Number1)
public Method(out int Number1)
Optional / Default
public Method(int Number1 = 10)
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext