• 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

Class finalization

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
src:http://technoheads.blogspot.com/

Class finalization can be done by implementing the following method:static void classFinalize() throws Throwable;True Or False?
(1)True
(2)False
Answer : 2
Explanation : PREVIOUSLY: If a class declares a class method classFinalize that takes no arguments and returns no result: static void classFinalize() throws Throwable { . . . } then this method will be invoked before the class is unloaded . Like thefinalize method for objects, this method will be automatically invoked only once. This method may optionally be declared private, protected, or public. NOW: Class finalization has been removed from the Java language. Thefunctionality of JLS 12.7 is subsumed by instance finalization (JLS 12.6).Here is a rationale for this decision. http://java.sun.com/docs/books/jls/class-finalization-rationale.htmlSimilar thing has happend toclass unloading: A class or interface may be unloaded if and only if its class loader is unreachable (the definition of unreachable is given in JLS 12.6.1). Classes loaded by
the bootstrap loader may not be unloaded

Question: what is meant by class finalization and instance finalization.
[ May 09, 2008: Message edited by: Jesper Young ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic