title: JAVA: missing return statement
body: <p>my main concern with this code as of right now is a missing return statement. </p>
  
  <pre><code>public class stringstuff{
  
      //using charAt    
      public static String ReverseF(String n){
          String finalstring = "";
          int len = n.length();
          for (int i = 0; (i &lt; n.length()); i++){
              finalstring += (n.charAt(len - i - 1));
          }
          System.out.println(finalstring);
      }
  
      public static void main(String[]args){
          ReverseF("Hello");
      }
  }
  </code></pre>
  
  <p>Using this code I only get the error: </p>
  
  <pre><code>stringstuff.java:11: missing return statement
  }
  ^
  1 error
  </code></pre>
  
  <p>If I switch the System.out.println to return, I don't get any errors but I also don't get an answer for ReverseF("Hello");</p>