title: Palindrome Recursion Program
body: <pre><code>public static boolean palindrome(String input, int i, int j)
   {
    if (i &gt;= j)
     return true;
    if (input.charAt(i) == input.charAt(j))
    {
     i++;
     j--;
     palindrome(input, i, j);
    }
    else if (input.charAt(i) != input.charAt(j))
     return false;
   }
  </code></pre>
  
  <p>My Java platform (eclipse) won't accept this code as working, due to a "lack of return type."  Now I know in proper coding ediquite, it's better to use only one return value, but when it comes to recursion, this is somewhat new to me.  How can I go about doing this?  If I instantiate a Boolean type at the top of this method, it's creating a new instance of that variable (and instantiating it as null or whatever I set it to) each time the method runs, but if I place it above my constructor, my method won't assign a value to it/can't return it.</p>
  
  <p>Basically, how do I go about modifying my code to have a single return value that Eclipse will accept as always executing?  I can do this easily enough with loops, but I'm not sure how to approach the topic with Recursion.</p>