Memory Out Of Bound Exception In Java