The reason your program is failing is because Java arrays start from 0, not 1. So, when you try to reference array[5], you are really trying to access the 6th element of the array. This of course...