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
Based on your research and understanding, write a 3- to 4-page Microsoft Word document that:
Over [174]

Answer:

....

Explanation:

3 0
3 years ago
A ____ is a device that interconnects two or more workstations in a star-wired bus local area network and immediately retransmit
prisoha [69]

Answer:

A HUB

Explanation:

A hub can described as an hardware or network device use for multi purpose functions like connecting series of internet devices together there by making it possible for all devices to work or function together on a single network.

Hubs are classified into active hub, passive hub, and intelligent hub.

ACTIVE HUB: This type of hub boost the signals but can not perform calculations.

PASSIVE HUB: this type only send the signals but can not boost a signal.

INTELLIGENT HUB: it brings about the boosting of signals and also bring about packets to be analyzed.

7 0
3 years ago
. Which of the following refers to the informal rules for how to behave online? A.
natta225 [31]

Answer:

D.netiquette

hope it is helpful to you

5 0
3 years ago
Meats ages hair and feathers all contain this monomer
OverLord2011 [107]

Answer:Amino Acid

Explanation:

All proteins have amino acids

7 0
2 years ago
Horizontal lines should be avoided in photographs t/f
Temka [501]
I belived its true is the answer
3 0
2 years ago
Other questions:
  • Plato :
    14·2 answers
  • Business Risks are ​
    15·1 answer
  • Why does people that gets abused not report?
    5·1 answer
  • What are six external parts of a computer
    11·1 answer
  • The logical view of a database system refers tohow a user or programmer conceptually organizes and understands the data. how the
    5·1 answer
  • 1. Why is photographing lightning a difficult process?
    11·2 answers
  • What is the best motivation that you can do/give to make your employees stay? ​
    6·1 answer
  • Salvado has a flash dish of is GB
    6·1 answer
  • PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?
    10·1 answer
  • When must an Assured Equipment Grounding Conductor Program (AEGCP) be in place?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!