1.

In case of using abstract class or function overloading, which function is supposed to be called first?(a) Local function(b) Function with highest priority in compiler(c) Global function(d) Function with lowest priority because it might have been halted since long time, because of low priorityI have been asked this question in examination.My question comes from Polymorphism in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Correct answer is (b) Function with highest priority in compiler

The explanation: Function with highest priority is called. Here, it’s not about the thread SCHEDULING in CPU, but it focuses on whether the function in local SCOPE is PRESENT or not, or if scope resolution is used in some way, or if the function matches the argument signature. So all these things DEFINE which function has the highest priority to be called in runtime. Local function could be one of the answer but we can’t say if someone have used POINTER to another function or same function name.



Discussion

No Comment Found

Related InterviewSolutions