index out of bounds error
807598Dec 14 2005 — edited Dec 14 2005Hi,
I have a problem with the index out of bounds error for a vector.
I have initialised a vector that is same size as a previous vector declared in my program and inserted a float object in all the positions.
The code below is a for loop to do just this where count is the size of the previous vector.
for(int i=0;i<count; i++)
{
vLargest.setElementAt(zero,i);
}
the float object is declared as
Float zero = new Float(0.0)
The error that i'm getting is
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
at java.util.Vector.setElementAt(Vector.java:492)
at ReadFile.makeData(ReadFile.java:62)
at ReadFileTest.main(ReadFileTest.java:10)
Can anybody tell me what this means?
Thanks