InterviewSolution
| 1. |
Context free grammar for recognition of function of overloading |
|
Answer» In some PROGRAMMING languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations. Calls to an overloaded function will RUN a specific IMPLEMENTATION of that function appropriate to the context of the call, allowing one function call to perform different tasks depending on context.For example, doTask() anddoTask(object o) are overloaded functions. To call the LATTER, an object must be passed as a parameter, whereas the former does not require a parameter, and is called with an empty parameter field. A common error would be to assign a default value to the object in the second function, which would result in an ambiguous call error, as the COMPILER wouldn't know which of the two methods to use. |
|