title: Uses unchecked or unsafe operations
body: <p>I keep getting an error that says: 
  Note: ABag.java uses unchecked or unsafe operations.</p>
  
  <p>I googled it and found <a href="https://stackoverflow.com/questions/197986/what-causes-javac-to-issue-the-uses-unchecked-or-unsafe-operations-warning">this</a> post, and made the changes that I thought would remove the error but I continue to get the error. </p>
  
  <p>Is there anything else I can do to stop getting this error message?</p>
  
  <pre><code>public class ABag&lt;Item&gt; implements BagInterface&lt;Item&gt;
  {
  private ArrayList&lt;Item&gt; bag;
  
  //creates an empty bag
  public ABag(){
      bag = new ArrayList&lt;Item&gt;();
  }
  
  //creates an empty set with initial capacity
  public ABag (int initialCapacity){
      bag = new ArrayList&lt;Item&gt;(initialCapacity);
  }
  
  
  public boolean add(Item newEntry){
      if (newEntry == null)
          return false;
      else
      {
          bag.add(newEntry);
          return true;
      }
  }
  
  
  public boolean isFull(){
      return false;
  }
  
  
  public Item[] toArray(){
      Item[] temp = (Item[])bag.toArray();
      return temp;
  }
  
  
  public boolean isEmpty(){
      return false;
  }
  
  
  public int getCurrentSize(){
      return bag.size();
  }
  
  
  public int getFrequencyOf(Item anEntry){
      int count = 0;
      if (!(bag.contains(anEntry)))
      {
          for (int i=0;i&lt;bag.size();i++)
          {
              if (bag.get(i) == anEntry)
                  count++;
          }
      }
      return count;
  }
  
  
  public boolean contains(Item anEntry){
      return bag.contains(anEntry);
  }
  
  
  public void clear(){
      bag.clear();
  }
  
  
  public Item remove(){
      int size = bag.size();
      Item removed = bag.remove(size-1);
      return removed;
  }
  
  
  public boolean remove(Item anEntry){
      return bag.remove(anEntry);
  }
  }
  </code></pre>
  
  <p>Thank you in advance!</p>