Declaring Initializers

Java classes can contain statements that support the initialization of program variables. Initialization is typically performed when a field variable is declared. Variable initializers are executed when a new instance of a class is created. Other initializers, referred to as static initializers, are used to initialize static variables. Static initializers are covered later in this chapter in the “static” section.

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.