• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • 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
 
Marshal
Posts: 27275
87
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: 13062
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic