Win a copy of Head First Android this week in the Android forum!
    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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

finalize() ?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Which of the following are true ? Select six answers?

1. The signature of finalize() method is, protected void finalize() throws Throwable{}

2. The signature of finalize() method is, public void finalize() throws Throwable {}

3.The signature of finalize() method is, void finalize() throws Throwable {}

4.The signature of finalize() method is, private void finalize() throws Throwable {}

5.The finalize() method can be Overloaded.

6.The throws clause of the finalize() method can be defined with any exception.

7.The finalize() method is guaranteed to be called on any object to be GC'ed.

8.The finalize() method is called only once on any object to be GC'ed.

9.There is no restriction on the number of times the finalize() method is called on an object to be GC'ed.
test says that 1,2,5,6,7,8 is correct answers. Why 2 is coorect?
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
2 is correct because you can override finalize() method
with a wider accessiblity in a new class.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I'm closing this thread since you posted it twice...

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic