Solved

Recursive Helper Method - no output

Posted on 2013-12-03
1
287 Views
Last Modified: 2013-12-03
public class Sheldon {
public static void main(String[] args) {
     
           reverseDisplay("123456");
}
    public static void reverseDisplay(String value){
        reverseDisplay(value, value.length() -1);
        }
    public static void reverseDisplay(String value, int high){
        if (high < 0){
            System.out.print(value.charAt(value.length()-1));
            reverseDisplay(value.substring(0, value.length()-1));
    }
    }

}

Open in new window


This builds with no problem but there is no output. I would expect to see 654321 on the console.
0
Comment
Question by:lostinspace9
1 Comment
 

Accepted Solution

by:
lostinspace9 earned 0 total points
ID: 39692485
nevermind...It was a small mistake... High should be >= 0.. Thanks anyhow.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 113
How  can  i  resolve  HTTP Status 404 -? 8 43
Chrome and Firefox Java 5 51
web project error add remove 1 29
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question