• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Garbage collection

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found this on a mock exam.....
If a Runtime Exception is thrown in the finalize method -
1. The running application crashes.
2. The exception is simply ignored and the object is garbage collected.
3. The exception is simply ignored, but the object is not garbage collected.
4. The Exception causes the JVM to crash.
The answer given is 2. But I thought it would be 4.
The JVM exits when it encounters a call to System.exit(0), right??? The same would hold true if System.exit() was coded in the finalize() method. Then why isin't 4. true???
Thanks,
Shafeeq
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which book said RuntimeException is same as System.exit?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic