• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception

 
Chetan Dodiya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one doubt....
try{
----
/* Exception occurs */
----
}
finally{
---
---
}
What if,any of the exceptions occurs in the try block???
catch clause is not there to handle the exception...
 
Rekha Srinath
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case of unchecked exceptions, the finally block will be executed and the exception will be called to the calling method.

In case of checked exceptions, you have to declare the exception in the methods or handle it in any of the functions in the call stack.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic