View Single Post
  #3 (permalink)  
Old 01-30-2008, 01:25 AM
gibsonrocker800's Avatar
gibsonrocker800 gibsonrocker800 is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
Quote:
Originally Posted by ravian View Post

StringIndexOutOfBoundsException is subclass of IndexOutOfBoundsException. So I believe that my catch will catch both Exceptions. Is this right?
I think it actually has to be IndexOutOfBoundsException that needs to be caught. Because, if you were to put Exception e instead, it catches any type of Exception. So, its the same case here, the superclass is the one that needs to be caught. Correct me if I'm wrong.
__________________
//Haha javac, can't see me now, can ya?
Reply With Quote