By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

ArrayIndexOutOfBoundsException

P: 1
float[] rTOT1;
rTOT1 = new float[j];

for ( j = 0; j < rTOT1.length; j++) {
float minValue = rTOT1[0];
rTOT1[j] = (alfaTOT * rSRC + betaTOT * rSRC) / depthSrc;
if (rTOT1[j] < minValue) {
minValue = rTOT1[j];
}



if (rTOT1[j] < minScore) {
minScore = rTOT1[j];
bestFunct = supply;
bestIndex = j;
}}
Mar 14 '12 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
You are accessing an index that does not exist in your array.
System.out.println the values of j at strategic points to see where your logic is incorrect
Mar 14 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.