• 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

what if a runtime exception happen inside a finalize method

 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What will happen if a runtime exception happen inside finalize method.

options are
a) application will break down
b) the object in finalize method will be released
c) the object will not be released
d) none of these
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this looks like a question from some test or book. We require you quote your source for anything you post here if it is not your original work.

thanks
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear friend...i got it from a question paper..of a recruitment exam..
i do remember the question paper series..QF1 and i think its not a good thing to say the company name


 
Ranch Hand
Posts: 537
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well basically if you speak of finalize means the program created everything properly and JVM ran properly without exceptions. Also finalize is run for a object. So what type of object are they talking and reassigning it to a reference variable so that its not eligible for GC won't throw and exception. Basically i think there won't be any exceptions in a finalize. But if there are any exceptions is thrown then it will halt the finalization process that's all. Application won't break down. C is the appropriate answer here. Object won't be gc'd but is still elligible for GC. But next time it will be gc'd as finalize on the object just runs once.
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Nitish ...
 
reply
    Bookmark Topic Watch Topic
  • New Topic