Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Exception

 
Vrushank Shukla
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator


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
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator
Why and Which Exception You Expect to be Thrown?
 
Vrushank Shukla
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think it would be StringIndexOutOfBound.
 
Shahir Deo
Ranch Hand
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator


java.lang.StringIndexOutOfBoundsException
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Locking as duplicate of http://www.coderanch.com/t/608535/java/java/Exception
 
    Bookmark Topic Watch Topic
  • New Topic