Java
45 articles in this topic

Packages and Access Modifiers in Java: Visibility Rules with Runnable Examples
Learn how Java package boundaries change member visibility. Compile a complete example covering public, protected, package-private and private access.

OOP Basics in Java: Classes, Objects and the Four Pillars with Runnable Examples
Connect Java's OOP syntax to design decisions with a complete Account example. Trace two objects through validation, overriding and runtime dispatch to exact output.

Classes and Objects in Java: Build and Trace Two Objects Step by Step
Build a Java Student class, create two independent objects, and trace fields, methods, aliases, null references, output, and common errors step by step.

Abstraction and Interfaces in Java: Abstract Classes, Contracts and Runnable Examples
Learn when Java needs an abstract class, when it needs an interface, and how both work together in one runnable charge-calculation program with exact outputs.

Wrapper Classes and Autoboxing in Java: Worked Examples and Null Traps
Learn why Java wrapper classes exist, how boxing and unboxing work, and where nulls, reference identity, and overload selection create surprises.

Synchronization in Java: Monitors, Race Conditions and Runnable Examples
Learn why Java threads lose updates, what each synchronized form locks, and how to build safe counters, inventory checks and condition-waiting code.

Java Streams API Tutorial: Filter, Map, Reduce and Collect with Runnable Examples
Learn Java streams from the source-to-terminal mental model, then trace operations, reductions and collectors through runnable examples and practice tasks.

Optional in Java: Null-Safe Patterns with Runnable Examples
Learn Java Optional from creation to stream pipelines through one user lookup. Trace present and empty paths, compare fallbacks, and repair common mistakes.

Executor Framework in Java: Thread Pools, Futures and Runnable Examples
Separate tasks from threads, trace a two-worker pool, and learn how futures, shutdown, cancellation and bounded queues behave in Java.

Generics in Java: Type Parameters, Bounds, Wildcards and Runnable Examples
Build type-safe Java containers, then trace generic methods, upper bounds, wildcard reads and writes, invariance, erasure, and common failure cases.

Constructors in Java: Types, Chaining and Runnable Examples
Learn how Java selects and chains constructors with complete programs for object state, overloads and inheritance. Includes common errors and practice exercises.

Java File I/O and NIO Tutorial: Streams, Path, Files, Channels and Buffers
Learn which Java file API to choose, then run one program that writes and reads text, archives a file, traces an 8-byte buffer, and checks exact output.