• Source
    1. import java.util.*;
    2. import java.lang.*;
    3. import java.io.*;
    4.  
    5. /* array_unique */
    6. class Ideone
    7. {
    8. public static void main (String[] args) throws java.lang.Exception
    9. {
    10. Integer[] data = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    11. Set<Integer> set = new HashSet<Integer>(Arrays.asList(data));
    12. set.toArray();
    13. System.out.print(set);
    14. }
    15. }