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 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?
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.
Track | Exercise | Changes |
---|---|---|
C# | basics | None |