Cannot count number in ArrayList using java
<p>I am using the List as shown below:-</p>

<pre><code>List&lt;Integer&gt; integerlist = new ArrayList&lt;Integer&gt;();

integerlist=primeFactors(numberToBERadical);
</code></pre>

<p>The primeFactors method return me some number when i sysOut as:-</p>

<pre><code>System.out.println("interger list=="+integerlist);
interger list==[2, 2, 2, 3, 5]
</code></pre>

<p>My Problem is i want to count how many time that each number appears so that i can show Like this:-</p>

<pre><code>2^3 * 3 * 5
</code></pre>

<p>Any Idea Will help to me.</p>

<p>thanks.</p>
