Determining a Palindrome using Stack and Queue in java
<p>Here I am trying to determine if a word or phrase is a palindrome by using stacks and queues depending on the phrase I write in. </p>

<p>What it is doing is that it says that everything is a palindrome and writes "Palindrome" by how many letters it has. </p>

<p>I'm guessing that I need to add something between the last for loop and the while loop, but I'm not sure what.</p>

<pre><code>public class CheckPalindrome {

public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    while (true) {

        String line = reader.readLine();


        if (line.toLowerCase().equals("quit")) {
            break;
        }

        Stack&lt;Character&gt; stack = new Stack&lt;Character&gt;();

        Queue&lt;Character&gt; queue = new LinkedList&lt;Character&gt;();

         for (int i = 0; i &lt; line.length(); i++) {
                stack.push(line.charAt(i));
            }

         for (int i = line.length() - 1; i &gt;= 0; i--) {
             queue.add(line.charAt(i));
         }

          while (!queue.isEmpty()) {
             if (queue.remove().equals(stack.pop())) {
                 System.out.println("Palindrome");
             } else {
                 System.out.println("Not a Palindrome");
             }
         }

      }     
   }
}
</code></pre>