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 83 of 109Java Null Reference: Practical Ways to Avoid NullPointerException
A Java null reference is a common source of NullPointerException. Learn practical techniques—defensive checks, Objects.requireNonNull, Optional, and more—for handling nulls safely.
Java Reference Variables: How Object References Work
java reference variable: Understand how Java reference variables store object addresses, affect assignment and method calls, and interact with null and garbage collect...
Java Object Assignment: Reference vs Value Semantics
Understand how Java object assignment works: assignment copies object references, not the objects themselves. See how aliasing, safe copying, and immutability help avoid unintended shared state.
Java Object Reference: What Variables Actually Hold
Understand how Java object references work: heap storage, pass-by-value behavior, null handling, and equality checks.
Java Object Initialization: Order and Constructors
Understand how Java initializes objects: field defaults, initializer blocks, constructors, static initialization, and inheritance order.
Understanding Java Class Members: Fields, Methods, and More
Learn about Java class members—fields, methods, and nested types—and related class structures: constructors, access modifiers, and static vs instance behavior, with practical examples.
Java Static Fields: Lifecycle, Memory, and Thread Safety
java static fields: How Java static fields behave: initialization timing, class loading, memory visibility, thread safety, and when to avoid shared static state.
Java Instance Fields: Declaration, Initialization, and Access
Understand Java instance fields: declaration, initialization, access, and management of per-object state in Java classes.
Java Fields: Declaration, Visibility, and Behavior
java fields: Learn how Java fields work: declaration syntax, access modifiers, static vs instance, initialization, and thread-safety considerations.
Java Class vs Object: What Actually Differs at Runtime
java class vs object: Understand the real difference between a Java class and an object: compile-time template vs runtime instance, memory layout, and how the JVM trea...