Top "Indexoutofboundsexception" questions

An exception that occurs when you attempt to access an object that is outside the boundaries of the container.

Java string split with "." (dot)

Why does the second line of this code throw ArrayIndexOutOfBoundsException? String filename = "D:/some folder/001.docx"; String extensionRemoved = filename.split(".")[0]; …

java regex string split indexoutofboundsexception
IndexError: list index out of range and python

I'm telling my program to print out line 53 of an output. Is this error telling me that there aren't that …

python list indexoutofboundsexception
Initial size for the ArrayList

You can set the initial size for an ArrayList by doing ArrayList<Integer> arr=new ArrayList<Integer&…

java arraylist indexoutofboundsexception
ArrayIndexOutOfBoundsException when using the ArrayList's iterator

Right now, I have a program containing a piece of code that looks like this: while (arrayList.iterator().hasNext()) { //value …

java arraylist iterator indexoutofboundsexception
Java substring: 'string index out of range'

I'm guessing I'm getting this error because the string is trying to substring a null value. But wouldn't the ".length() &…

java substring indexoutofboundsexception
How do I get the first n characters of a string without checking the size or going out of bounds?

How do I get up to the first n characters of a string in Java without doing a size check …

java string indexoutofboundsexception
Why doesn't list have safe "get" method like dictionary?

Why doesn't list have a safe "get" method like dictionary? >>> d = {'a':'b'} >>> d[…

python list exception indexoutofboundsexception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 exception

I am getting the error java.lang.IndexOutOfBoundsException: Index: 0, Size: 0. public Collection<AdDistribution> getAdDistribution(byte srch, byte cont) …

java indexoutofboundsexception
index out of bounds exception java

So the error message is this: Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(…

java debugging exception indexoutofboundsexception
Insert at any position in java.util.List

According to the docs you can insert objects an any position in a List: The user of this interface has …

java list indexoutofboundsexception