Index out of bound exception

Why it shows IndexOutOfBoundException as array is of size 8 and we are accessing 6th element why the default value is not printed