Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,980 guides across 14 topics

Topics

Latest guides

Diagram contrasting Java final and static keywords showing class-level membership versus immutable assignment.
Java

Java final vs static: What Each Keyword Controls

java final vs static: Understand the difference between Java's final and static keywords, how they combine into constants, and when to use each in real code.

java keywordsstaticfinalimmutability
Diagram showing a final variable being assigned once in a Java constructor, with a lock icon symbolizing immutability.
Java

Java Final Variable Initialization Rules

java final variable initialization: Understand the rules for initializing final variables in Java—blank finals, compile-time constants, and common initialization errors.

final keywordJava initializationcompile-time constantblank final
Abstract illustration of a lock or seal representing the final keyword in Java, with a class, method, and variable symbol.
Java

Java Final Keyword: Usage and Behavior

How Java's final keyword works on variables, methods, and classes: reassignment errors, blank final fields, and final references versus immutable objects.

final keywordJava modifiersimmutabilityconstant variables
Illustration of a Java final variable as a locked reference, with a single assignment arrow and a forbidden second assignment symbol.
Java

Java Final Variable: Syntax, Behavior, and Use Cases

Java final in practice: single assignment, blank final fields, effectively-final lambdas, and why a final reference is still mutable.

final keywordJava syntaximmutabilityvariable initialization
Illustration of a local variable overshadowing an instance variable in Java, with clear visual layers.
Java

Java Variable Shadowing Explained

java variable shadowing: Understand Java variable shadowing: how local variables and parameters can hide fields, the pitfalls, and how to avoid confusion.

variable shadowingJava scopingfield hidinglocal variables
Diagram showing Java variable scope boundaries with nested blocks and shadowing example.
Java

Java Variable Scope: Rules and Examples

java variable scope: Understand Java variable scope: block scope, shadowing, lifetime, and how local variables, fields, and parameters behave in practice.

variable scopeJava syntaxblock scopeshadowing
Diagram comparing instance and static variable storage in Java objects and class memory
Java

Instance vs Static Variables in Java: Key Differences

Understand the difference between instance and static variables in Java, including memory, lifecycle, and when to use each.

Javastatic variablesinstance variablesobject-oriented programming
Diagram contrasting a Java instance variable attached to an object on the heap with a local variable confined inside a method call on the stack.
Java

Java Local vs Instance Variable: Key Differences

Learn how local and instance variables in Java differ in scope, lifetime, initialization, memory behavior, and thread safety, with code examples of common pitfalls.

Variable ScopeInstance VariablesLocal VariablesThread Safety
Diagram contrasting a single shared static variable box with multiple per-instance variable boxes, illustrating java static variable scope.
Java

Understanding Java Static Variables

Explore Java static variables: their syntax, memory model, usage in constants and counters, thread-safety implications, and best practices.

static keywordclass variablesmemory managementconcurrency
Illustration of Java objects each carrying their own instance variable values, symbolizing independent object state.
Java

Java Instance Variable Explained

Learn what a Java instance variable is, how it stores object state, and how to use it correctly with initialization, access, and scope rules.

instance variablesJava fieldsobject stateJava OOP