Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is function overloading?
Think about having multiple tools with different functions but the same label.
Give one simple example of function overloading.
Consider functions that can show either numbers or strings.
What is the purpose of function overloading?
Consider why we might want similar functions to have the same name.
True or False: Function overloading can only occur if the functions have different names.
Think about how we define overloaded functions.
Create an overloaded function 'process' that can accept either a list of integers or a single string that describes a series of numbers separated by commas.
Consider how you might handle both a collection and a descriptor.
Write a class with an overloaded method 'drawing' that can accept either a string for a shape or a number for a size.
Think about what features might differ based on input types.
5 more questions in this section. Enroll free to practise them all.
Enroll free