Alguém sabe me dizer porque o código abaixo gera este erro:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7 at algoritmos.Teste.main(Teste.java:10)
public class Teste {
    public static void main(String[] args) {
        int[] num = {0, 0, 0, 0, 0, 0, 0};
        int c;
        c = 0;
        while (num[c] != 10  &&  c < 7 ) {
            c++;
        }
        System.out.print(c);
    }
}