Ask Question

When mehtod X calls method Y, method Y called methhod Z, and method Z calles method X, this is called

A. An error

B. Mutual recursion

C. tail recursion

D. indirect recursion

+3
Answers (1)
  1. 21 February, 21:20
    0
    D. Indirect Recursion.

    Explanation:

    Indirect recursion is when a method calls other method which calls the original method again.

    For example:-

    public static int mthd1 (int n)

    {

    if (n = = 0)

    return 0;

    else

    return (mthd2 (n-1));

    }

    public static int mthd2 (int n2)

    { return mthd1 (n2-1); }

    This is an example of indirect recursion. Where mthd1 calls mthd 2 and mthd 2 calls mthd 1 again.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “When mehtod X calls method Y, method Y called methhod Z, and method Z calles method X, this is called A. An error B. Mutual recursion C. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers