Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
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

Misconception
ForVariableScopeBeyondLoop
The scope of variables declared in a for loop header extends beyond the loop
Misconception
LoopBodyScopeImpliesLoopLifetime
Lifetime of variables declared in a loop body extends across all loop iterations
Misconception
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