Variables
Compare how variable declaration, scoping, and mutability work across languages and examine their execution mechanics.
Cross-Language Reference Table
Click on a highlighted concept to explore detailed comparison and code examples.
| Concept | Python | Java | JavaScript | C | C++ |
|---|---|---|---|---|---|
| Declaration | x = 5 | int x = 5; | let x = 5; | int x = 5; | int x = 5; |
| Scope | Function / Global | Block / Method / Class | Block / Function / Global | Block / Function / File | Block / Function / Namespace |
| Constants | CAPITAL_NAME (convention) | final | const | const / #define | const / constexpr |
Explore Concepts
Select a variable concept below to learn more
Declaration & Initialization
Explore how variables are declared, static vs. dynamic typing, and memory initialization across languages.
Scope & Lifetime
Learn how blocks, functions, and files bound variable visibility and define how long they live in memory.
Mutability & Constants
Understand constants, read-only bindings, and how to safely handle variable mutation across systems.