Ask Question
29 June, 20:06

Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5. If m4 has just terminated, what method will resume execution?

+1
Answers (1)
  1. 29 June, 20:12
    0
    M2 is the answer for the above question.

    Explanation:

    The above question states the scenario, where firstly main function calls the M1 function. Then M1 function calls the function M2. Then M2 function calls the function M3. Then M3 function calls the function M5. Then Again M2 function will resume and calls the function M4. Then Again M2 function will resume because when the M4 will ends it return to the statement of the M2 function from which the M4 function has been called. It is because when any function ends its execution it returns to that line of a statement from which it has been called. This is the property of programming language to call the function. So when the M4 will terminate its execution then the M2 function will resume again.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5. If m4 has ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers