How to display quantity of each item entered in ArrayList String?
<p>I have an <code>ArrayList</code> of <code>String</code> where user enters number of items and when they enter the keyword <code>stop</code>, code displays the number of items entered and then the how many items are on their <code>list</code>. for example, if i entered apple, apple, Apple, banana, stop, total number of items is 4 and apple x2 Apple x1 banana x1. 
i'm having trouble with the last part, which is displaying the quantity of whatever is entered. this is what I have so far
EDIT: I don't know/haven't used HashMap, I know only up to using ArrayList</p>

<pre><code>public static void main(String[] args) {
    ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();

    System.out.println("Enter the what you wish to purchase:");
    Scanner read= new Scanner(System.in);
    String item  = read.nextLine();

    while(!item.equals("stop")) {
        list.add(item);
        item = read.nextLine();
    }
    System.out.println("Total items: " +list.size());
}
}
</code></pre>