class xpto { private float[][] matriz; public boolean processaAlvo( float alvo ) { int y, x; boolean achou = false; pesquisa: for( y = 0; y < matriz.length; y++ ) { for( x = 0; x < matriz[y].length; x++ ) { if( matriz[y][x] == alvo ) { achou = true; break pesquisa; } } } if( ! achou ) { return false; } // processa o alvo em matriz[y][x] de alguma forma return true; } }
CONTROLAR LOOPS EXTERNOS A PARTIR DE LOOPS ANINHADOS INTERNOS
JAVA PROVÊ O BREAK E CONTINUE COM LABELS
EXECUTAR CÓDIGO DE LIMPEZA ANTES DE SAIR DE UM BLOCO DE CÓSIGO OU DE UM MÉTODO
USE BREAK COM LABEL OU TRY/FINALLY (VIDE ADIANTE)