Well, if your loop ever finished, you would probably be getting an index out of bounds exception, because a1[a1.length] is not a valid index. Array indexes range from 0 to the length-1.
But, that is...