Method

Overloading

The return type is not part of the method signature! 主要區別在方法名稱以及參數

Value types v.s Reference types

When passing a value type to a method, a copy of that value becomes available to the method.Any change is made inside the method will not affect the short.

When passing the reference to a method, what we actually pass is a pointer to the place in memory that stores the variable.

Example : Value Types

Example : Reference Type

Passing value types by reference (ref)

Use one method return multiple value ( out keyword)

Last updated