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
OlgaM077 [116]
4 years ago
6

Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f

low") should return "wolf". Hint: Reverse the substring starting at the second character, then add the first character at the end. For example, to reverse "flow", first reverse "low" to "wol", then add the "f" at the end.
Computers and Technology
1 answer:
Aneli [31]4 years ago
5 0

Answer:

Explanation:

StringRecursiveReversal.java

public class StringRecursiveReversal {

   static String reverse1 = "";

   public static String reverse(String str){

       if(str.length() == 1){

           return str;

       } else {

           reverse1 += str.charAt(str.length()-1)

                   +reverse(str.substring(0,str.length()-1));

           return reverse1;

     }

   }

   public static void main(String a[]){

       StringRecursiveReversal srr = new StringRecursiveReversal();

       System.out.println("Result: "+srr.reverse("flow"));

   }

}

Output :

Result: wolf

You might be interested in
An ink-jet printer is a type of impact printer. <br> a. True <br> b. False
Mumz [18]
The answer is: false it is not a impact printer
6 0
3 years ago
The _______ command was developed by nicholas harbour of the defense computer forensics laboratory.
Lena [83]
Hi! The answer is dcfldd
3 0
3 years ago
in a mechanism ,when the input goes from a small gear to an output which is a larger gear the speed will _____
dsp73
The speed (rotations per minute) will decrease.
3 0
3 years ago
Put the pieces of a function into the correct order as if you were writing a formula.
riadik2000 [5.3K]

The correct order for the pieces of a function is:

  1. =
  2. function
  3. arguments

<h3>What is a function?</h3>

In Computer programming, a function can be defined as a named portion of a block of executable code that performs a specific task, which is usually a single, related action.

This ultimately implies that, a function comprises a group of related statements (block of code) that only runs and returns a data when it is called.

In conclusion, =NOW() is an example of the correct order for the pieces of a function.

Read more on a function here: brainly.com/question/19181382

4 0
3 years ago
How to add a bill using the reciept capture?
HACTEHA [7]

Answer: add up all the numbers and then add the tax and then 30% of the total for the tax

Explanation:

like 3+6+8+10=26

26 30%=whatever that is and then add it all up againg and thta is your answer.

5 0
3 years ago
Other questions:
  • If memory accesses take 100 times more than register accesses, then a LOAD instruction will take ___ machine cycles than an ADD
    7·1 answer
  • What is the maximum data transfer rate of an ieee 1394a device?
    5·1 answer
  • My tv is hdtv but it does not show the name of the channels
    15·1 answer
  • An example of live footage is when?
    10·2 answers
  • Delivering is not considered in supply chain analysis when outside carriers are contracted to move products to customers.
    15·1 answer
  • A class can inherit behavior from a parent but also define its own and override parent behavior. This is called:
    8·1 answer
  • How can a search be narrowed to only search a particular website????
    15·1 answer
  • Design and implement an application that reads a string from the user then determines and prints how many of eachlowercase vowel
    8·1 answer
  • you are working in the headquarters of an organization and you're asked to deal with the interruption in services due to network
    5·1 answer
  • attackers typically use ack scans to get past a firewall or other filtering device. how does the process of an ack scan work to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!