kodejava-lang-package/src/main/java/org/kodejava/example/lang/UniqueArray.java
public static int[] toUniqueArray(int[] array) {
        int[] temp = new int[array.length];
        for (int i = 0; i < temp.length; i++) {
            temp[i] = -1; // in case u have value of 0 in the array
        }

        int counter = 0;
        for (int i = 0; i < array.length; i++) {
            if (isUnique(temp, array[i]))
                temp[counter++] = array[i];
        }

        int[] uniqueArray = new int[counter];
        System.arraycopy(temp, 0, uniqueArray, 0, uniqueArray.length);
        return uniqueArray;
    }
/**
     * Convert the given array to an array with unique values
     * without duplicates and returns it.
     */
Convert the given array to an array with unique values
without duplicates and returns it.
Convert the given array to an array with unique values without duplicates and returns it .
public static int[] toUniqueArray(int[] array) {
        int[] temp = new int[array.length];
        for (int i = 0; i < temp.length; i++) {
            temp[i] = -1; 
        }
        int counter = 0;
        for (int i = 0; i < array.length; i++) {
            if (isUnique(temp, array[i]))
                temp[counter++] = array[i];
        }
        int[] uniqueArray = new int[counter];
        System.arraycopy(temp, 0, uniqueArray, 0, uniqueArray.length);
        return uniqueArray;
    }
public static int [ ] toUniqueArray ( int [ ] array ) { int [ ] temp = new int [ array . length ] ; for ( int i = 0 ; i < temp . length ; i ++ ) { temp [ i ] = - 1 ; } int counter = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( isUnique ( temp , array [ i ] ) ) temp [ counter ++ ] = array [ i ] ; } int [ ] uniqueArray = new int [ counter ] ; System . arraycopy ( temp , 0 , uniqueArray , 0 , uniqueArray . length ) ; return uniqueArray ; }
Convert the given array to an array with unique values
 without duplicates and returns it.
Convert the given array to an array with unique values without duplicates and returns it .
// in case u have value of 0 in the array