title: Does Not Take Parameters in Java
body: <p>I'm receiving the  error "type Stack does not take parameters public class ArrayStack implements Stack" from this code:</p>
  
  <pre><code>public class ArrayStack&lt;E&gt; implements Stack&lt;E&gt; {
  
  private E[] data;
  
  private int size;
  
  public ArrayStack() {
  data = (E[])(new Object[1]);
  size = 0;
  }
  
  public boolean isEmpty() {
  return size == 0;
  }
  
  public Object pop() {
  if (isEmpty()) {
      throw new EmptyStructureException();
  }
  size--;
  return data[size];
  }
  
  public Object peek() {
  if (isEmpty()) {
      throw new EmptyStructureException();
  }
  return data[size - 1];
  }
  
  protected boolean isFull() {
  return size == data.length;
  }
  
  public void push(Object target) {
  if (isFull()) {
      stretch();
  }
  data[size] = target;
  size++;
  }
  
  protected void stretch() {
  E[] newData = (E[])(new Object[data.length * 2]);
  for (int i = 0; i &lt; data.length; i++) {
      newData[i] = data[i];
  }
  data = newData;
  }   
  }
  </code></pre>
  
  <p>"type Stack does not take parameters public class ArrayStack implements Stack"</p>
  
  <p>The stack class is as follows.</p>
  
  <pre><code>public interface Stack&lt;E&gt; {
  
  public boolean isEmpty();
  
  public E peek();
  
  public E pop();
  
  public void push(E target);
  
  }
  </code></pre>