you get an ArrayIndexOutOfBoundsException because the index of an array is zero-based and the length field of the array is not zero-based. so if you want to get the last char in the array you must...