import java.util.*;
class Demo2
{
public static void main(String a[])
{
int arr[]={6,4,5,5,7};
ArrayList arrylist = new ArrayList();
for (int i=0; i<arr.length; i++)
{
if (!arrylist.contains(arr[i]))
arrylist.add(arr[i]);
}
for (int i = 0; i<arrylist.size();i++)
{
System.out.print(arrylist.get(i) + ", ");
}
}
} |