Java guides
Every published Java guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Java guides
Most readLatest Java guides
Page 108 of 109Java 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.
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.
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.
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.
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.
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.
Understanding Java Static Variables
Explore Java static variables: their syntax, memory model, usage in constants and counters, thread-safety implications, and best practices.
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.
Java Variable Declaration vs Initialization
Understand the difference between declaring and initializing Java variables, including default field values, local definite-assignment rules, final fields, and var.
Java Local Variable Scope and Rules
Understand Java local variables: scope, lifetime, shadowing, effectively final rules, and var usage with practical code examples.