Professional Documents
Culture Documents
Using Methods
1
2
Objectives
– The return type for a method can be any type used in the C#
programming language
– A method can also return nothing, in which case the return type is
void
– A method’s return type is also known as a method’s type
Writing Methods That Return Values
18
– The return type for a method can be any type in the C# programming
language
– In C#, you can write methods with four kinds of formal parameters
listed within the parentheses in the method header
– Overloading a method involves writing multiple methods with the
same name, but with different arguments
– The compiler determines which of several versions of a method to call
based on argument lists