Tag

Static Initialization

1 views collected around this technical thread.

IT Services Circle
IT Services Circle
Mar 18, 2022 · Fundamentals

Understanding Meyers' Singleton in C++: Why Static Local Variables Matter

This article explains the proper C++ singleton implementation known as Meyers' Singleton, showing how a static local variable inside a getInstance() function ensures thread‑safe lazy initialization, avoids static‑initialization‑order problems, and handles inheritance correctly.

C++Design PatternMeyers' Singleton
0 likes · 6 min read
Understanding Meyers' Singleton in C++: Why Static Local Variables Matter
IT Services Circle
IT Services Circle
Feb 4, 2022 · Fundamentals

Understanding the Execution Order of Static Blocks, Instance Blocks, Constructors, and Regular Code Blocks in Java

This article explains the definition, execution timing, and practical uses of Java static code blocks, instance (constructor) code blocks, constructors, and regular code blocks, and demonstrates their exact execution order—including parent‑child class initialization—through clear code examples and output analysis.

Code BlocksConstructorsExecution Order
0 likes · 8 min read
Understanding the Execution Order of Static Blocks, Instance Blocks, Constructors, and Regular Code Blocks in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Nov 24, 2020 · Fundamentals

Understanding Java Static Variable and Static Block Initialization Order

This article explains how Java initializes static variables and static blocks, demonstrates the order with ThreadLocal hash‑code generation examples, analyzes class loading rules, and summarizes the impact on object instantiation and inheritance hierarchies.

Class LoadingJVMJava
0 likes · 8 min read
Understanding Java Static Variable and Static Block Initialization Order
Java Captain
Java Captain
Jan 29, 2018 · Fundamentals

Understanding the Lifecycle of Java Classes in the JVM

This article explains the complete lifecycle of a Java class within the JVM, covering memory areas such as the method, heap, and stack regions, and detailing the five stages—loading, linking, initialization, usage, and unloading—along with code examples illustrating active and passive references.

Class LoadingInitializationJVM
0 likes · 16 min read
Understanding the Lifecycle of Java Classes in the JVM