public class BreakDemo {
public static void main(String[] args) {
int[] arrayDeInts = { 32, 87, 3, 589, 12, 1076,
2000, 8, 622, 127 };
int rechercheVal = 12;
int i = 0;
boolean trouvé = false;
for ( ; i < arrayDeInts.length; i++) {
if (arrayDeInts[i] == rechercheVal) {
trouvé = true;
break;
}
}
if (trouvé) {
System.out.println("foundIt " + rechercheVal + " à l'index " + i);
} else {
System.out.println(rechercheVal + "non trouvé dans le tableau");
}
}
}