Boolean

Não estou conseguindo descobrir qual é o erro desse método

	public static boolean pesSeq(int x,int vet[])
	{
		int i;
		i=0;
		while(i<vet.length && vet[x]!=x) i++;
		
			if(i==vet.length)
				return false;
			
			 else
			 return true;
			
		
	}

Alguém sabe…??

O compilador me fornece a seguinte menssagem de erro:

Traduzindo:

mas estou retornado valores booleano,não estou conseguindo
identificar qual é o erro.

Opa, qual versão do JAVA vc está usando?

	public static boolean pesSeq(int x, int vet[]) {
		int i;
		i = 0;
		while (i < vet.length && vet[x] != x)i++;

		return  !(i == vet.length);
	}

:slight_smile:

E ai fabio blz cara foi um vacilo bobo mais aki
é porque eu estava colocando o return dentro do while,
o while não é obrigado a executar, ou seja, talvez nunca entre no while, caso isso aconteça não haverá retorno algum tirei as condições do while e deu certo…!