title: InFix to Post Fix Converter
body: <p>I have tried to change my code and debug it but I am always getting the wrong converter. Can anyone help show me where the error is? </p>
  
  <pre><code>public class Driver {
      static String postfix;
  
      public static void main(String[] args) {
          String me = "((5+6)*(7-8))";
          String a =changeFromInfixToPostfi(me);
          System.out.println(a);
      }
  
      public static String changeFromInfixToPostfi(String s) {
          LinkedStack stack = new LinkedStack();
          String postfix = "";
          for (int i = 0; i &lt; s.length(); i++) {
              if (Character.isDigit(s.charAt(i)))
                  postfix += s.charAt(i);
              else {
                  postfix += ",";
                  if (stack.isEmpty())
                      stack.Deposit(s.charAt(i));
                  else {
                      while (!stack.isEmpty()) {
                          if (!checkstackTop(stack.MyPeek(), s.charAt(i) +"")) {
                              stack.Deposit(s.charAt(i));
                              break;
                          }
                          else {
                              postfix += stack.Withdraw() + ",";
                              if (stack.isEmpty()) {
                                  stack.Deposit(s.charAt(i));
                                  break;
                              }
                          }
                      }
                  }
              }
          }
          while (!stack.isEmpty())
              postfix += "," + stack.Withdraw();
          return postfix;
      }
  
      public static boolean checkstackTop(Node top, String schar) {
          if ((top.equals("*") || top.equals("/"))
                  &amp;&amp; (schar.equals("+") || schar.equals("-")))
              return true;
          else if ((top.equals("+") || top.equals("-"))
                  &amp;&amp; (schar.equals("+") || schar.equals("-")))
              return true;
          else if (top.equals("(") &amp;&amp; schar.equals(")"))
              return true;
          else if (top.equals("(") &amp;&amp; schar.equals("("))
              return true;
          else if ((top.equals("*") || top.equals("/"))
                  &amp;&amp; (schar.equals("*") || schar.equals("/")))
              return true;
          else if ((top.equals("+") || top.equals("-") || top.equals("*") || top
                      .equals("/")) &amp;&amp; schar.equals(")"))
              return true;
          return false;
      }
  }
  </code></pre>