The reason you're getting an ArrayOutOfBoundException is because after using the split on a single word (without spaces) you do not have 2 values in your array, so you should first make sure there...