posted 20 years ago
IndexOutOfBoundsException, ArrayIndexOutOfBoundsException and
StringIndexOutOfBoundsException all inherit from RuntimeException
(indirectly in the case of ArrayIndexOutOfBoundsException and StringIndexOutOfBoundsException). Anything inheriting from
RuntimeException is considered a non-checked exception, and
does not have to be declared to be thrown by a method. However, while
you don't *have* to declare it, you *may* declare it. So in this case,
you could declare either one by itself, neither, or both.
A+, Network+, SCJP, SCWCD<br />preparing for SCBCD, SCEA, CompTIA I-Net+