title: How to create a class that implements java.util.collections
body: <p>I am trying to create a class  say <code>MyStack</code> that would implement a java.util.collections class. <code>MyStack</code> will override some methods of the collections class like add(similar to push), remove(similar to pop) etc.. I intend to model the class on the same lines as a <code>Set</code> or  other interfaces of the collection class except that <code>MyStack</code> would not be an interface or abstract class and that we can create objects of type <code>MyStack</code>. </p>
  
  <p>I have problems with the syntax as I am not sure if I am proceeding in the right direction.All I have so far is something like this - NOTE - None of the methods have been defined so far - I am trying to get teh skeleton right before proceeding to define the methods. </p>
  
  <pre><code>import java.util.*;
  
  
  public class MyStak implements java.util.Collection&lt;E&gt;{
  
      public boolean add(E o){
  
                 return false;        
          }
  
         public boolean addAll(Collection c){
          return false; 
  
          }
  
         public void clear() {
  
         }
  
          public boolean contains(Object o){
            return false;
  
          }
  
          public boolean containsAll(Collection o){
            return false;
  
          }
  
          public boolean equals(Object c){
            return false; 
          }
  
          public int hashcode(){
            return 0; 
          }
  
          public boolean isEmpty(){
            return false; 
          }
  
          public Iterator iterator(){
            return null;
  
          }
  
          public boolean remove(Object o){
            return false; 
          }
  
          public boolean removeAll(Collection o){
            return false; 
          }
  
          public boolean retainAll(Collection o){
            return false; 
          }
  
          public int size(){
            return 1; 
          }
  
           public Object[] toArray(){
             return null;
  
           }
  
           public Object[] toArray(Object[] a){
             return null; 
           }
  
      }
  </code></pre>
  
  <p>I have a couple of compile time errors like - </p>
  
  <pre><code>    +public class MyStak implements java.util.Collection&lt;E&gt;{
  Multiple markers at this line
      - The type MyStak must implement the inherited abstract method 
       Collection&lt;E&gt;.add(E)
      - E cannot be resolved to a type
  
      +public boolean add(E o){
  Multiple markers at this line
      - E cannot be resolved to a type
      - implements 
       java.util.Collection&lt;E&gt;.add
  </code></pre>
  
  <p>Any code modifications, examples , corrections to my code , links to tutorials etc will we highly appreciated. </p>