title: Returning a string entered as reverse text in Java
body: <p>I'm trying to make a method that returns a string of words in opposite order.</p>
  
  <p>IE/ "The rain in Spain falls mostly on the"
      would return: "the on mostly falls Spain in rain The"</p>
  
  <p>For this I am not supposed to use any built in Java classes just basic Java.</p>
  
  <p>So far I have:</p>
  
  <pre><code>    lastSpace = stringIn.length(); 
  
      for (int i = stringIn.length() - 1; i &gt;= 0; i--){
          chIn = stringIn.charAt(i);
          if (chIn == ' '){
              word = stringIn.substring(i + 1, lastSpace);
              stringOut.concat(word);
              lastS = i;
          }
      }
      word = stringIn.substring(0,lastSpace);
      stringOut.concat(word);
  
      return stringOut;
  </code></pre>
  
  <p>My problem is when <code>stringOut</code> is returned to its caller it always is a blank string.</p>
  
  <p>Am I doing something wrong? Maybe my use of <code>string.concat()</code>?</p>