Solved

Consider the Mutually Recursive Methods Below

Question 104

Multiple Choice

Consider the mutually recursive methods below. Select the method call that could be used to generate the output sequence: A5 B4 A3 B2 A1 public static void methodA(int value)
{
If (value > 0)
{
System.out.print(" A" + value) ;
MethodB(value - 1) ;
}
}
Public static void methodB(int value)
{
If (value > 0)
{
System.out.print(" B" + value) ;
MethodA(value - 1) ;
}
}


A) methodA(5) ;
B) methodB(5) ;
C) methodA(4) ;
D) methodB(4) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents