This is my second program in Java, and its the first time I'm using an arrayList. I searched about how to convert it, and used the methods i found, but I get an error...
package eliminarepetidos;
import java.util.ArrayList;
import java.util.Random;
public class Eliminarepetidos {
public static ArrayList<Integer> eliminaRepetidos (int[] vet){
    ArrayList<Integer> retorna = new ArrayList<>();
    for(int i = 0; i<vet.length; i++){
        for (int j = i + 1; j < vet.length; j++)
            if ((vet[i] == vet[j])&&(vet[i]!=0)) vet[j]=0;                      
        if(vet[i]!=0) retorna.add(vet[i]); }
    return retorna;
}
public static void imprime (int[] vet, int numElem){
    System.out.print("Vetor resultante:");
    for (int i = 0;i<numElem;i++)    
        System.out.print(" " +vet[i]);       
}
public static void main(String[] args) {
    int[] t;
    t = new int[10];
    Random generator = new Random();
    for(int i = 0; i<10; i++)
        t[i] = generator.nextInt(12) +9;
    ArrayList<Integer> temporario = new ArrayList<>();
    temporario = eliminaRepetidos(t);
    int [] vetfinal = temporario.toArray(new int[temporario.size()]); //line with error
    imprime(vetfinal,vetfinal.length);
}
}
How should I be using the command to make it work properly? Thanks!