1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Firlakuza [10]
3 years ago
5

Given the following class code: public class RecurseSample { public static void main(String[] args) { System.out.println(recurse

(3)); } public static int recurse(int n) { int total = 0; if (n == 0) { return 0; } else { total = 3 + recurse(n - 1); } return total; } } What values will be printed when this code is executed?
Computers and Technology
1 answer:
Kipish [7]3 years ago
4 0

Answer:

The output of the given code is "9".

Explanation:

In this question, a class "RecurseSample" inside the class a "recurse" method is declared that holds that holds an integer variable as the parameter, and inside the method a total variable is declared and uses a conditional statement to check the n variable value that is equal to 0 if it is true it will return 0. In the else block it call the method and add value in the total variable, and returns its value. In the main method, the print method is used that prints the above method values.

You might be interested in
How is AI used in racing ?
NikAS [45]
This now allows human pilots to race together with AI drivers. The AI driver is, in this case, the intelligent software that gathers all data from the sensors and other touchpoints to drive the car.
3 0
3 years ago
BRAINLIEST!!!!!!!!!!!!!!
Contact [7]

Answer:

Open

Explanation:

Trust

6 0
2 years ago
Read 2 more answers
Information dashboards enable ________ operations that allow the users to view underlying data sources and obtain more detail.
Alja [10]

I believe what you meant is Performance Dashboard and the correct answer is drill-down/drill-through

Prοvidе visual displays οf impοrtant infοrmatiοn that is cοnsοlidatеd and arrangеd οn a singlе scrееn sο infο can bе digеstеd at a singlе glancе.

4 0
3 years ago
What are at least three differences between a personal and non-personal blog?
qwelly [4]
The difference betweeen personal and nonpersonal blogs are that on a personal blog you give out most information you dont want people to know or it is anonomys 
4 0
3 years ago
All the answers I've got is 0, which seems strange but I'm sure I'm following this algorithm correctly.
Salsk061 [2.6K]
I think its six. im not sure but it could be another on.                                                                     

7 0
4 years ago
Other questions:
  • When you make a pointer variable im C++, is star label a must?
    9·1 answer
  • I need the answer to the below question *ASAP*
    12·2 answers
  • Whenever Jim starts his laptop, he sees some commands and numbers appearing on his screen. These instructions are being processe
    12·2 answers
  • The possible states of a process are:
    6·2 answers
  • Budgets help you to do all of the following expect
    15·2 answers
  • 3. Assume a disk drive from the late 1990s is configured as follows. The total storage is approximately 675MB divided among 15 s
    11·1 answer
  • Which technology is predominately used for contactless payment systems?
    11·1 answer
  • What HTML tag would you use to indicate a line break?
    5·1 answer
  • Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam
    7·1 answer
  • .NET
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!