Programming Misconceptions
Home
Misconceptions
Concepts
Languages
Textbooks
Contributors
About
Home
Languages
Java
jls21
Kinds of Variables
Java Language Specification, Version Java SE 21 Edition
4.12.3. Kinds of Variables
Read this Section of the Authoritative Specification
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.12.3
3 Documented Misconceptions
ForVariableScopeBeyondLoop
The scope of variables declared in a for loop header extends beyond the loop
LoopBodyScopeImpliesLoopLifetime
Lifetime of variables declared in a loop body extends across all loop iterations
UndeclaredVariables
Variables can be used even without being declared beforehand
Find Misconceptions by...
Concept
Programming Language
Notional Machine
Textbook
About
About This Site
Structure and Content of the Inventory
Contributors