
-----------------------------------
umaster
Mon Mar 24, 2008 12:59 pm

Array index out of bounds
-----------------------------------
Hey im pretty new to Java just started about 4 weeks ago and so far its ok some things are a bit confusing. Anywho i get this array index out of bounds exception = 5 error. I know that it is checking for a part of the array that doesn't exist but that is not possible seeing as how the loop on goes 5 times and there is definetly 5 values. I clearly am not seeing somthing and i need mores eyes to look at it from a different perspective maybe the problem can be found

Here is my code:

/*
 * Main.java
 *
 * Created on March 5, 2008, 2:17 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author XXXXX
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        double dblAveragenames[]= {0,0,0,0,0};
        double dblAverageclass[]= {0,0,0,0,0};
        double dblsum = 0;
        int intcount3 = 0;
        int intCount = 0;
        int intcount2 = 0;
        String strNames[] = {"Burishnakov","Chow Min","Greg","Bob","Josh"};
        String strClass[] = {"Computers","Civics","Chemistry","Bio With Mike O","Physics"};
        double dblMarks[][] = {{87.6,83.4,72.5,64.3,67.8},{82.5,68.9,52.0,23.4,83.2},{73.6,77.8,63.1,32.5,72.1},{71.6,73.6,61.0,63.2,75.3},{35.9,58.6,42.3,87.6,13.2}};
        for(intCount=0; intCount