title: Counting number of different object types in an ArrayList
body: <p>For this program I have an arraylist for animals full of objects from two subclasses (Fish and Tiger class)  I am having a hard time figuring out how to count each item type so I can print it out. I need it to say something like There are 3 tigers and 2 fish.
  Here is my code thus far</p>
  
  <pre><code>import java.util.*;
  public class Menagerie{
     public static void main(String [] args){
        /* ArrayList to hold animal data */
        ArrayList&lt;Animal&gt; alist = new ArrayList&lt;Animal&gt;();
        /* object creations */
        Tiger jtiger = new Tiger("Javan Tiger", "Tiger acreage #6");
        Fish fnfish = new Fish("False network catfish", "Fresh Water");
        Tiger btiger = new Tiger("Bengal tiger", "Ritchie area of RIT");
        Fish shark = new Fish("Shark", "Salt Water");
        Tiger stiger = new Tiger("Siberian Tiger", "Tiger acreage #4");
  
        /* Adding objects to alist ArrayList */
  
        alist.add(jtiger);
        alist.add(fnfish);
        alist.add(btiger);
        alist.add(shark);
        alist.add(stiger);
  
        /* printing out animal information using toString() */
  
        System.out.println("Report on animals...");
        System.out.println(jtiger.toString());
        System.out.println(fnfish.toString());
        System.out.println(btiger.toString());
        System.out.println(shark.toString());
        System.out.println(stiger.toString());
  
  
  
  
  
     }
  
  
  }
  </code></pre>
  
  <p>Any help will be great! thanks.</p>