Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
Local Variable Declarations

Java Language Specification, Version Java SE 21 Edition
14.4. Local Variable Declarations

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.4

6 Documented Misconceptions

Misconception
ControlledLocalAccess
One can control access to local variables using access modifiers
Misconception
ForVariableScopeBeyondLoop
The scope of variables declared in a for loop header extends beyond the loop
Misconception
LocalVariablesAutoInitialized
Local variables are automatically initialized
Misconception
LoopBodyScopeImpliesLoopLifetime
Lifetime of variables declared in a loop body extends across all loop iterations
Misconception
NoLocalVariables
There are no local variables
Misconception
UntypedVariables
Variable declarations don't need a type

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors