Como percorrer um array de string?

3 respostas
worlock257

Galera sei que é meio tosco eu perguntar isso mas tá chato implementar isso. Preciso percorrer um array de string:

String cifra [] = {"a","b","c","d","e","f","g","h","i","j","l","m","n","o","q","r","s","t","u","v","x","z"};
        
        
        
        for (int i = 0; i < cifra[].length; i++ ){

}

3 Respostas

worlock257

Ou melhor preciso saber o tamanho do array de string.

P
for (String s : cifra ) {
  System.out.println(s);
}

para verificar o tamanho:

int tamanho = cifra.length;
worlock257

Vlw! Tava tentando percorrer com array[].lenght.
Vacilo!

Criado 31 de agosto de 2011
Ultima resposta 31 de ago. de 2011
Respostas 3
Participantes 2