fork download
  1. class Teste30 {
  2. public static void main(String[] args) {
  3. String teste = "Isso funciona mesmo, ok?";
  4. String [] vetor = teste.split(" ");
  5. String aqui = vetor[0];
  6. String ali = vetor[1];
  7. String acola = vetor[3];
  8. String there = vetor[4];
  9. for (String nome : vetor) System.out.println(nome);
  10. }
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/172144/101
Runtime error #stdin #stdout #stderr 0.06s 32588KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
	at Teste30.main(Main.java:8)