Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.3 KB

method_overloading.md

File metadata and controls

31 lines (20 loc) · 1.3 KB

Methods

The Concept

Method overloading allows a [class][classes] to have multiple [methods][methods] with the same name. Methods with the same name must be different from each other in at least one aspect, like the number of parameters or the type of the parameters.

What to cover

  • What is method overloading? What is it? Why is it useful?
  • How to define overloaded methods How to define overloaded methods.
  • How are overloaded methods different from each other? What makes one overloaded method different from each other? The number of parameters? The parameter types?
  • How to invoke an overloaded method How to invoke an overloaded method. How does the compiler/runtime know which overload to call?

Exercises

RPG Game Master

This exercise has a Game Master for an RPG game describe the game state to the players. The reference implementation (C#) teaches:

  • How to define overloaded methods.
  • How to call an overloaded method.

Implementations

Track Exercise Changes
C# basics None