I would like to display a message indicating if an input value is present in my rollValue array.
My code does't correctly identify such numbers. This search method is what I have attempted, but why doesn't it display the correct message?
public void search(int value)
{
for (int i = 0; i < rollValue.length; i++)
{
if (rollValue[i] == value)
{
System.out.println(value + " was found");
}
else
{
System.out.println(value + " was not found");
}
break;
}
}