how to find the max value of an arraylist and two of its Index position using java
<p>Pls anybody suggest how to find the maximum value from an arraylist with its index position using java. </p>

<pre><code>ArrayList ar=new ArrayList;
ar.add(2);
ar.add(4);
ar.add(12);
ar.add(10);
add(12);

String obj = Collections.max(ar);
int  index = ar.indexOf(obj);

System.out.println("obj max value is"+obj +" and index position is"+ index);
</code></pre>

<p>In the above program, it just returns the output as obj max value is 12 and index position is 2.</p>

<p>But my actual output want to be as index position will be 2 and 4 (Bcoz max value 12 is present in two index position). Please suggest any ideas. Thanks in advance.</p>
