English
Topic 5. Methods: parameters, overloading, recursion
Goal: become familiar with declaring and calling C# methods, parameter passing, and overloading; learn to divide a program into methods and use ref and out parameters, optional and named arguments, and params; master recursive algorithms and memoization.
Lecture contents
- Declaring methods — Why methods are needed · Method declarations · Expression-bodied methods and naming
- Passing parameters — Passing parameters by value · ref, out, and in parameters · Optional parameters and named arguments · params parameters
- Overloading and recursion — Method overloading · Returning multiple values · Recursion · XML comments
- Examples and common mistakes — Example programs · Common mistakes