I'm trying to check if a vowel exists in a string, if found I use break; to break the loop and return a message, but it doesn't work.
String palabra="manzana";
String[] arrayPalabra=palabra.split("");
String[] vocales=new String[]{"a","e","i","o","u"};
var listVocals=Arrays.asList(vocales);
for (int i=0;i<arrayPalabra.length;i++) {
boolean existe = listVocals.contains(arrayPalabra[i]);
if(existe==true){
System.out.println("Existe vocal");
break;
}else{
System.out.println("NO Existe vocal");
break;
}
}