• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finalize!

 
ashok khetan
Ranch Hand
Posts: 153
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a Runtime Exception is thrown in the finalize method -

a) The running application crashes.
b) The exception is simply ignored and the object is garbage collected.
c) The exception is simply ignored, but the object is not garbage collected.
4) The Exception causes the JVM to crash.
Select the correct answer.
 
Rashmi Tambe
Ranch Hand
Posts: 418
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct answer is B.
Even if finalize method throws runtimeException , it is ignored and the object is garbage collected.
correct me if i am wrong.
Rashmi
 
Gagan Indus
Ranch Hand
Posts: 346
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
agree wid Rashmi
b) The exception is simply ignored and the object is garbage collected. ( but NOT immediately , remember )
( tho , think tht options culd hav been better-wordered )

------------------
Gagan (/^_^\)
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic