Files
developer-roadmap/roadmaps/java/content/initializer-block@dg_UpaO8TzIN7w_QZ1n-6.md
T
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

865 B

Initializer Block

An initializer block in Java is a block of code, enclosed in curly braces {} , that is executed when an instance of a class is created. It's used to initialize instance variables or perform setup tasks before the constructor is called. There are two types: instance initializer blocks, which run every time a new object is created, and static initializer blocks, which run only once when the class is first loaded.

Visit the following resources to learn more: