posted 14 years ago
Have you initialised the 1st element in the array to anything? If not you will suffer a NullPointerException there too.
Remember if you declare anything, that doesn't have any value until you initialise it. If you have a 15-member array, then you have 15 references which all point to null until you tell them otherwise.