I am trying to ask a user to input elements, but if the user inputs a repeated element my method should return false. So far this is what I have... Thank you in advance!
public boolean setGuess(int index, int value) // required by instructor
{
int [] guesses = new int[countVal]; //countVal is array length
for (int i = 0; i < guesses.length; i++)
for (int j = 0; j < i; j++)
{
if (guesses[i] == guesses[j])
return false;
}
return true;
}