public class Homework {
public static void main(String[] args) {
int [] tablica = {10,20,30,5,10,15};
int suma = 0;
for (int i=0; i<=tablica.length; i++){
suma = suma + tablica[i];
System.out.println(suma);
}
}
}
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
at Homework.main(Homework.java:16)
Process finished with exit code 1