• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Finally not run

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome,

in which situations the finally block does not run? It is mentioned in K&S, that such situations exist and "we'll cover it later", but I haven't found any info about it.
 
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Arkadiusz!


Welcome to the Ranch!






I think the only occasion finally does not run is when you have a System.exit before it can start:


prints only:
caught, yummy!


Yours,
Bu.
 
Arkadiusz Przechodzki
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you

Also for such nice welcome though I won't play here for long, I have the exam the day after tommorow... I've found this great forum much to late. Today I make the last revision

Regards
Arkadiusz Przechodzki
Poland
 
Sheriff
Posts: 27463
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, the finally block does not run if there is a loop in the try block that runs forever:
 
lowercase baba
Posts: 13082
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Arkadiusz Przechodzki:
...though I won't play here for long, I have the exam the day after tommorow...



There is much more here than certification prep. We hope you stick around!!!
[ September 17, 2007: Message edited by: Fred Rosenberger ]
 
Arkadiusz Przechodzki
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes indeed Thanks for all your answers.

Regards
Arkadiusz Przechodzki
 
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic