import unique elements out of ArrayList in Java
<p>I've <code>ArrayList</code> (get_unique) of type integer where in I have to insert only unique values in
it. how can I do it??</p>

<p>I've got it some idea to do the same in javascript but do not know how to do it in Java?</p>

<pre><code> &lt;%
ArrayList&lt;Integer&gt; get_unique = new ArrayList&lt;Integer&gt;();
ArrayList&lt;Integer&gt; set_unique = new ArrayList&lt;Integer&gt;();
// how do it 
%&gt;
</code></pre>

<hr>

<pre><code>&lt;script language="JavaScript"&gt;
&lt;!--
// note: you will need to populate the myList() array with values!
var myList = new Array(); 
var uniqueList = new Array();
var uniqueListIndex = 0;

for (i=0;i&lt;myList.length;i++) {
    var temp = myList[i];
    var unique = true;
    for (j=0;j&lt;uniqueList.length;j++) {
        if (temp == uniqueList[j]) {
            unique = false;
            break;
        }
    }

    if (unique == true) {
        uniqueList[uniqueListIndex] = temp;
        uniqueListIndex++;
    } 
}
&lt;/script&gt;
</code></pre>
