ArrayIndexOutOfBoundsException in jsp

<% try{ int a[] =new int[6]; for(int i = 0; i<7; i++){ a[i]=i; } }catch(Exception e){ out.println("Exception:"+e); } %>