Hello, Am using a dynamic array. Can this dy namoc array grow to hold any number of integers? Or is there a limit that Java places on it? The error am getting is : java.lang.ArrayIndexOutOfBoundsException Can some brief me on this? Thanks.
You can change an array reference to access an array object of any size, but an array object has a fixed size. ArrayIndexOutOfBounds means that you are trying to access past the end of an array object.
If you posted code, perhaps we could figure out what you are doing and where it should be fixed...
-Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Thanks , I would like to post the code. But its like 2000 lines of code. If it is still ok. Let me know, and I'll post it up. Thanks for the help by the way. yours respectfully Avin Sinanan
What did you mean by dynamic array? an array created at run time? using new Type[not_compile_time_constant_int_expression_] ? java arrays always have a fixed size. what you need is a List implementation, like java.util.ArrayList or java.util.Vector.
tobe bondhu nouka bherao<br />shonabo gaan aj shara raat
If you use ArrayList or Vector, you must also wrap your int values as Integer values. By using ArrayList (or Vector) the size of your array is not fixed it will grow as you add. With an array you must allocate a larger array and then copy to it.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.