Queues and Stacks
<p>I'm having trouble writing a program that determines whether a string is a palindrome that gets an input string from the user while skipping whitespace characters and punctuation, and ignoring differences in case, storing each character in both a stack and a queue. I already have it determining if it's a palindrome. The part i'm having trouble in is sorting it in the queue and stack. The following is what I have right now.</p>

<pre><code>import java.util.Scanner;

public class Pali
{

    static int length;
    static String st;
    static ListStack stack = new ListStack();
    static ListQueue lq = new ListQueue();
    static Scanner input = new Scanner(System.in);


  public static void main (String[] args)
 {
     text();
        String s = null;
     createStack(s);
        String q = null;
     createQueue(q);
  }


    public static void text()
    {

  String st, _n = "y";
  int left, right;
  Scanner scan = new Scanner (System.in);

  while (_n.equalsIgnoreCase("y")) 
  {
     System.out.println ("Enter a potential palindrome:");
     st = scan.nextLine();



     left = 0;
     right = st.length() - 1;

     while (st.charAt(left) == st.charAt(right) &amp;&amp; left &lt; right)
     {
        left++;
        right--;
     }

     System.out.println();

     if (left &lt; right)
        System.out.println ("That string is NOT a palindrome.");
     else
        System.out.println ("That string IS a palindrome.");

     System.out.println();
     System.out.print ("Test another palindrome (y/n)? ");
     _n = scan.nextLine();
    }

    }
    public static void createStack(String s)
    {
        for (int i = 0; i &lt; s.length(); i++)
        {
            stack.push(s.charAt(i));

    }

    }
    public static void createQueue(String q)
    {
        for (int i = 0; i &lt; q.length(); i++)
        {
            lq.enqueue(q.charAt(i));
        }
     }

    public static void palindrome(ListQueue l, ListStack m)
    {
       for(int i = 0; i &lt; m.size();i++)
       {


       }



   }
}
</code></pre>
