CSE2305 - Object-Oriented Software Engineering
Self Assesment Questions
For each question choose the single response which best answers the question, or which completes the statement most accurately.
Question 77: | What is "function overloading"? |
When a single function does more than one job in a program |
When a single function has more than one definition in a program |
When two or more functions have the same name and parameter types |
When two or more functions have the same name but different parameter types |
When two or more functions have different names but the same parameter types |
Question 78: | Why is function overloading useful? |
It conserves identifiers |
It allows us to give related functions a common (and logical) name |
It allows us to pass the same arguments to different functions |
It reduces the total number of functions, therefore improving program performance |
It increases the total number of functions, therefore improving program flexibility |
Question 79: | What is the "signature" of a function? |
The binary pattern it forms when converted to assembler |
A technical term for the unique name of the function |
A technical term for the unique combination of the name and parameter types of a function |
A technical term for the unique combination of the name, parameter types, and return type of a function |
None of the above |
Question 80: | How does the compiler work out which version of an overloaded function to call? |
It calls the first function it finds with the correct name |
It calls the "most recently defined" function |
It calls the fastest available function with the correct name |
It calls the function with the "unique closest" signature |
It calls the function with the "unique longest" signature |
Question 81: | How can a call to an overloaded function be ambiguous? |
Its name might be misspelled |
There might be two or more functions with the same name |
There might be two or more functions with equally appropriate signatures |
The function might have the right signature, but be inaccessible |
The function might be polymorphic |
Last updated: August 8, 2005