C# MethodsLesson 23Free preview
C# Method Overloading
This lesson is part of C# · All levels
Summary
Overloading means making several methods with the same name but different parameters, both quantity and type. The compiler automatically selects the most appropriate method based on the caller's argument. Thus, a single name can be used for a variety of input variations without confusing the user.
Key points
- Method overloading means the same name with different parameters.
- The type itself should not be the only difference between overloads.
- The compiler selects the overload that best suits the type of argument given.
- Optional parameters sometimes make one method feel like some overload.
- Overload is often used to provide a simpler version of the method.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.