Solved

Recursive Helper Method - no output

Posted on 2013-12-03
1
283 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
Comment Utility
nevermind...It was a small mistake... High should be >= 0.. Thanks anyhow.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now