Solved

How Many Times Will the Following Method Call Itself If

Question 27

Multiple Choice

How many times will the following method call itself if the value 10 is passed as an argument?
Public static void message(int n)
{
If (n > 0)
{
System.out.println("Print this line.\n") ;
Message(n + 1) ;
}
}


A) 1
B) 9
C) 10
D) An infinite number of times

Correct Answer:

verifed

Verified

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

Related Questions