This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes about nested try catch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about nested try catch" Watch "about nested try catch" New topic

about nested try catch

Chang Tzu-yu

Joined: Sep 17, 2007
Posts: 16
I don't understand about nested try catch

When has error, It didn't continue Loop, It run finally!!!
I don't know why it run like this???
Please tell me, thanks!!!

Chang Tzu-yu<br /> <br />SCJP 1.4
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

The code you posted is not real Java code, so that makes it a little bit harder.

If you want to use "continue", then you must do that inside the code block of the loop you are programming. You can't put "continue" somewhere else outside the block - that will not compile.

Try putting the try-catch block inside the block of the loop:

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Chang Tzu-yu

Joined: Sep 17, 2007
Posts: 16
Hi Jesper,
Thanks for your reply
I'll try it...
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: about nested try catch
Similar Threads
coninue after catch block
Doubt with Dan's Mock exam - Flow Control & Exception Handling Q7
exception handling
Help with Try-Catch-Finally statement