Bem estou fazendo um programa que retorna um valor false se não tiver valores repetidos dentro de um vetor e true se tiver valores repetidos mais está com erro e não estou sabendo identificar vo deixar o código ai abaixo quem souber me ajude…!
import java.util.Random;
public class Repetido
{
public static boolean (int vet[])
{
int i,j;
for(i=0;i<vet.length-1;i++)
{
for(j=i+1;j<vet.length;j++)
{
if(vet[i]==vet[j])
{
return true;
}
}
}
return false;
}
public static void main(String args[])
{
Random aleatorio = new Random();
int vet[] = new int [10];
int i;
for(i=0;i<vet.length;i++)
{
vet[i]=0+aleatorio.nextInt(10);
}
}
}