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
MrRissso [65]
2 years ago
10

Consider the following recursive method. public static string recur(int val) { string dig = "" + (val % 3); if (val / 3 > 0)

return dig + recur(val / 3); return dig; } what is printed as a result of executing the following statement? system.out.println(recur(32));
Computers and Technology
1 answer:
Oksana_A [137]2 years ago
5 0

The recursive method recur executes itself from within

When the statement System.out.println(recur(32)); is executed, the string value "2101" is printed

<h3>How to determine the output of the statement?</h3>

The flow of the program is as follows:

  • The method keeps updating the string variable dig with the remainder of the val variable divided by 3
  • When the remainder is less than or equal to 0, the method is exited

So, when 32 is divided by 3.

The remainders are 2, 1, 0 and 1

So, the output of the statement is "2101"

Read about java methods at:

brainly.com/question/19271625

You might be interested in
Proszę daje wszystko potrzebuje tego
Stolb23 [73]
I’m sorry I do not speak that
5 0
4 years ago
Read 2 more answers
Which statement about tuition is the most accurate?
Kisachek [45]

public colleges are cheaper for in-state residents

5 0
4 years ago
Read 2 more answers
David writes an essay as part of an assignment at school. He wants to indent the first lines of several paragraphs. With a word
Fudgin [204]
The answer is self explanatory, B
5 0
3 years ago
Read 2 more answers
What is computer hardware?list any 4 computer hardware​
Scilla [17]

Computer hardware includes the physical parts of a computer, such as the case, central processing unit (CPU), monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard. By contrast, software is the set of

8 0
3 years ago
Read 2 more answers
Consider the following code segment:
horrorfan [7]

Answer:

13333333333333333333333fv mvfdmv mfv fmv f mf vmf f vfmvnfmvnmnvmfnvmnvmnv3Explanation:

6 0
3 years ago
Other questions:
  • How is the numeric string that makes up a digital signature created?
    5·1 answer
  • What port does the DarkComet malware listen on?
    15·1 answer
  • Write a recursive, int-valued method named productOfOdds that accepts an integer array, and the number of elements in the array
    10·1 answer
  • Which of these converts the reciprocating motion of the piston into rotary motion?
    7·1 answer
  • All of the data in a digital book (letters, punctuation, spaces, etc) are stored and processed in a computer as binary. Break do
    15·1 answer
  • (b) A mouse is a display device. (c) A monitor is a television.​
    10·1 answer
  • Providing captions and transcripts for videos on your website is a way of ensuring what?.
    7·1 answer
  • A network administrator is importing a list of certificates from an online source, so that employees can use a chain of trust an
    10·1 answer
  • What are the two broad categories that individual definitional techniques fall under? Check all that apply. Demonstrative defini
    11·1 answer
  • Cycle technology implemented a dibs initiative last year for one of the manufacturing sites. however, the initiative is not prog
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!