• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

finalize and the JLS

 
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The spec says

If an uncaught exception is thrown during the finalization, the exception is ignored and finalization of that object terminates


What then happens to the object(whose finalization has terminated due to the exception)?
jeff mutonho
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jeff mutonho:
What then happens to the object(whose finalization has terminated due to the exception)?


The finalize method is invoked when an object is about to be garbage collected. If an exception is thrown from that code, it is ignored and the finalize method ends abruptly. Once the finalize method ends (whether normally or abruptly), the object is garbage collected.
 
reply
    Bookmark Topic Watch Topic
  • New Topic