Computers and Technology

Consider this method definition: static int someRecMethod( int n )
{ if ( n < 0 )
return -1;
return someRecMethod( n + 1 );
}
This method has the following problem -- or none (only one correct choice):
A) It will always return the same number no matter what is passed in as an argument from the client.
B) Nothing is wrong; it has both an explicit case and a recursive case.
C) It will sometimes return a -1 without error, and other times produce a runaway recursive call to itself resulting in a run-time error
D) It will always produce a runaway recursive call to itself resulting in a run-time error.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:50, carterjavon6929
Python write an expression that executes the loop body as long as the user enters a non-negative number. note: if the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "program end never reached." the system doesn't print the test case that caused the reported message. sample outputs with inputs: 9 5 2 -1
Answers: 3
image
Computers and Technology, 22.06.2019 21:00, bryanatwin1536
Describir textbook icon_person mira los dibujos y describe lo que estΓ‘ pasando. usa los verbos de la lista.
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, mazolethrin9632
Which of these is most responsible for differences between the twentieth century to the twenty-first century?
Answers: 2
image
Computers and Technology, 23.06.2019 00:30, Thisisdifinite
Which of the following would you find on a network
Answers: 3
Do you know the correct answer?
Consider this method definition: static int someRecMethod( int n )
{ if ( n < 0 )
re...

Questions in other subjects:

Konu
Mathematics, 26.05.2021 22:10
Konu
Mathematics, 26.05.2021 22:10