Question: The following problems use String manipulation to practice recursive methods. As part of your answer include comment(s) to identify: the base case and the recursive

The following problems use String manipulation to practice recursive methods. As part of your answer include comment(s) to identify:

the base case and
the recursive call.
 

Problem 1:

Write a recursive method that outputs a string in reverse on the console via the reverseDisplay(String) method.

public void reverseDisplay(String value)
{
    // TODO: complete the implementation
}
 

Problem 2:

Rewrite reverseDisplay(String) using a private helper method reverserHelper(String, int) to pass the substring int high index to the method.

Use then following helper method signature:

private void reverserHelper(String value, int high)
{
    // TODO: complete the implementation
}
 

 


Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Problem 1 Java code for the method reverseDisplay to display the input String in reverse order metho... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!