title: Java - moving first letter of string to the end, and determining if word is the same when spelled backwards
body: <p>I'm trying to make a program that when a user inputs a string using scanner, the first letter gets moved to the end of the word, and then the word is spelled backwards. The program then determines if you get the original word.</p>
  
  <p>e.g if user types in 'potato' the program will move 'p' to the end, and will display true, as we get the same word backwards - 'otatop'.</p>
  
  <p>Example output:
  You have entered "BANANA".
  Is ANANAB same as BANANA? True.</p>
  
  <p>Thank you in advance for any help.</p>
  
  <p>Jack</p>
  
  <p>This is what I've got so far, but I don't think it works properly.</p>
  
  <pre><code>public class WordPlay {
  
      public static void main(String[] args) {
  
          Scanner scanner = new Scanner(System.in);
          String word;
          String palindrome = "";
          String quit = "quit";
  
  
          do {
              System.out.print("Enter a word: ");
              word = scanner.nextLine().toUpperCase();
  
              int length = word.length();
  
              for (int i = length - 1; i &gt;= 0; i--) {
                  palindrome = palindrome + word.charAt(i);
              }
  
              if (word.equals(palindrome)) {
                  System.out.println("Is the word + palindrome + " same as " + word + "?", true);
              } else {
                  System.out.println(false);
              }
          } while (!word.equals(quit));
          System.out.println("Good Bye");     
          scanner.close();
  
      }
  
  }
  </code></pre>