473,614 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ArrayIndexOutOf BoundsException

1 New Member
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
1 1553
r035198x
13,262 MVP
You are accessing an index that does not exist in your array.
System.out.prin tln the values of j at strategic points to see where your logic is incorrect
Mar 14 '12 #2

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

Similar topics

1
10675
by: CM | last post by:
Hi, when i want connect me in my BD with a JSP (with this simple code), this exception is throw. Thank's for ur help Mathieu CODE of my JSP ---------------------
2
9822
by: David Stevenson | last post by:
Programs from: Sheng Liang, The Java Native Interface, Programmer's Guide and Specification, The Java Series, (c) 1999, pp. 38-39. I thought I copied the program pretty exactly, but I don't know why I am getting an ArrayIndexOutOfBoundsException. I tried to switch the jint size to int size in the function declaration prototype, but that didn't make any difference. I tried the "i" for loop with a range of i = 1 ; i <= size ; but that...
6
6467
by: ganesh.m | last post by:
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError:
31
2435
by: ivannavi | last post by:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String Temp = jComboBox1.getSelectedItem().toString(); testcomm.TestForm.WriteParamToPic("c"+Temp); } public static void WriteParamToPic(String ParamIn) {
22
41001
oll3i
by: oll3i | last post by:
i get Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at Producent.main(producent.java:605) when i run it from bat @start "Supply Chain Management-Producer to Queue" run Producent queue1 queue2 queue3 queue4 maybe you will se something i dont see
1
2425
by: al666940 | last post by:
Hello everyone, I'm coding card functions (shuffle, draw, etc) using the Vector class and functions, and I'm almost finished except for an exception that I can't seem to get rid of. Can anyone help me please? It's 2 lines of code which are causing the exception, and the problem is that I do not understand why it is throwing the exception, it should work. Either it's them or my FOR function containing them is somehow flawed. Lines are...
1
3709
by: shaikhussain | last post by:
public class EmployeeServicesTestCase { /** * @param args */ public static void main(String s)throws Exception { // TODO Auto-generated method stub BeanFactory beans=new XmlBeanFactory(new ClassPathResource("applicationContext.xml")); EmployeeService es=(EmployeeService)beans.getBean("employeeService");
2
2773
by: David Rothabuer | last post by:
I work with an integration engine that is java based. All my scripting is javascripting and I've run into a problem that I can't find a solution to. I am getting this error when I attempt to read from my database Wrapped java.lang.ArrayIndexOutOfBoundsException: -1 Here is the actual code (the "logger.error" lines tell Mirth to write the output to the dashboard)
1
1853
by: Buena Velasco | last post by:
I'm having trouble finding the error on my code. I know what "Exception thread ... ArrayIndexOutOfBounds... " means but I couldn't tell which part in the looping it is or in other. import java.util.*; public class RoundRobin { static Scanner console = new Scanner (System.in); public static void main (Stringargs)throws Exception {
1
2213
by: JanineXD | last post by:
I was browsing the web for examples on how to partition in Java. I've got to this website that has a detailed example about Partitioning so I've tried to run it on my JCreator Pro. I've only got one error, but I've tried all I can do to fix it ( Put BufferedReader, import java.io.*, throws IOException ), and It still wouldn't work. Here's the Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at...
0
8198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8591
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8294
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8444
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.