Usually to perform a conditional using a vector or a list and it is necessary to perform a for and perform the if line by line in this way.
//sendo item uma string e listaItens um List<String>
for(String lista: listaItens){
if(item.equal(lista){
return true;
}
}
I would like to know if there is a more effective way to perform this operation where the if itself already compares with the whole list without the need for for example if(variavel.equal(lista.asItem)
or something of the genre.