Solved

What Is the Output If the Method Call Is TestMyVal(6)

Question 91

Multiple Choice

What is the output if the method call is testMyVal(6) in the following code snippet?
Public static void testMyVal(int nval)
{
If (nval > 0)
{
TestMyVal(nval - 2) ;
}
System.out.print(nval + " ") ;
}


A) 0 2 4 6
B) 0 0 0 0
C) 6 6 6 6
D) 6 4 2 0

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