aspose file tools*
The moose likes Beginning Java and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Exception

Vrushank Shukla
Greenhorn

Joined: Sep 10, 2012
Posts: 14


Now, if the String length is 0, then reverse() method will throw an exception. But i didn't get any exception, the program compile and run fine. Why??
Shahir Deo
Ranch Hand

Joined: Mar 19, 2013
Posts: 80

Why and Which Exception You Expect to be Thrown?


Knowledge enlivens the soul.
Vrushank Shukla
Greenhorn

Joined: Sep 10, 2012
Posts: 14
I think it would be StringIndexOutOfBound.
Shahir Deo
Ranch Hand

Joined: Mar 19, 2013
Posts: 80



java.lang.StringIndexOutOfBoundsException
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Locking as duplicate of http://www.coderanch.com/t/608535/java/java/Exception
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception