title: Test with ADT exercise
body: <p>Hi all i'm making a simple exercise with stack ADT. I must return an inverted string using just a stack. That's the code I made:</p>
  
  <pre><code>public class StackInvertTEST {
      public static void main(String[] args) {
          Scanner tr = new Scanner(System.in);
          String temp=tr.next();
          System.out.println(invert(temp));
      }
  
  
  static &lt;E&gt; String invert(String str){
      Stack&lt;String&gt; stack = new ArrayStack&lt;String&gt;();
      String temp="";
      while(!str.isEmpty()){
          stack.push(str);
      }
      while(!stack.isEmpty()){
          temp=stack.pop();
      }
      return temp;
      }
  }
  </code></pre>
  
  <p>it wont work. It just doesn't return anything. Any suggestion? Thank you.</p>