title: Questions regarding a code with recursive methods
body: <p>I have some questions about this code </p>
  
  <pre><code>public static String reverseString( String s )
  {
    if ( s.length() == 0 )
      return "";
  
    String firstChar = s.substring( 0, 1 );
    String reverseRest = reverseString( s.substring( 1 ) );
  
    String result = reverseRest + firstChar;
  
    return result;
  }
  
  public static void main( String[] args ) 
  {
    String a = "The sky's the limit!";
    System.out.println( reverseString( a ) );
  }
  </code></pre>
  
  <p>Question 1: How exactly does the terminating circumstances work? How will s.length ever equal 0?</p>
  
  <p>Question 2: Why does the code need to have the "firstChar" to be able to reverse the string? Why doesn't the code work when reverseString takes in substring of 0 and not have to add the first character?</p>