Review the code below:
try {
arrayList.get(10);
} catch (StringIndexOutOfBoundsException e) {
...
}
I might get two exceptions here.
- StringIndexOutOfBoundsException
- IndexOutOfBoundsException
StringIndexOutOfBoundsException is subclass of IndexOutOfBoundsException. So I believe that my catch will catch both Exceptions. Is this right?