Multiple choice

When the compiler cannot differentiate between two overloaded constructors or methods, it is called

  1. overloading

  2. overriding

  3. ambiguity

  4. destructor

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Ambiguity is a state when there are two or more methods with the same prototype, the compile cannot differentiate between them and therefore displays an error. For example, if we have two functions called 'sum(int)' , the compiler will not be able to decide which method to call when the user writes a statement like 'sum(10)'.