Chapter 8. Initializers and Nested Classes
Classes and objects must be initialized before they're used. That task is performed by initializers. When the time arrives for an object to “die,” Java's garbage collection facility automatically destroys that object. However, before the garbage collector destroys the object, it calls that object's finalizer—a process known as finalization—to give the object an opportunity to release acquired resources. This chapter explores initializers (and the complementary garbage collection and finalization features). Also, nested classes—classes declared within classes or blocks (or even as parts of expressions)—are explored.
Initializers
Before a program can make use of a class or an object, that class or object ...
Get Java™ 2 by Example, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.