![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 02.07.2021 01:50, browneyedbaby20
A recursive method may call other methods, including calling itself. A recursive method has:
1. a base case -- a case that returns a value or exits from a method without performing a recursive call.
2. a recursive case -- calling the method again with a smaller case..
Study the recursive method given below.
For example, this call recursiveMethod (5); returns 15:
public static int recursiveMethod (int num) (
if (num == 0)
return 1;
else {
if (numX2!=0)
return num * recursiveMethod (num -1);
else
return recursiveMethod (num-1);
}
}
1 What is the base case?
2. What does the following statement check?
3. What does the method do?
![answer](/tpl/images/cats/otvet.png)
Answers: 3
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 17:20, jashaikamatuteowwp1p
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 3
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 21:40, DisneyGirl11
Which is a benefit of getting information from a government website? a. the information will be easy to understand. ob. the information will be the most current. oc. the information can be trusted.
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 02:00, akatherine1738
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
Do you know the correct answer?
A recursive method may call other methods, including calling itself. A recursive method has:
1. a b...
Questions in other subjects:
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 26.10.2020 14:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.10.2020 14:00
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.10.2020 14:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.10.2020 14:00
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.10.2020 14:00