Java

46 articles in this topic

Polymorphism in Java: Overloading, Overriding and Runnable Examples

Learn how Java chooses overloaded methods at compile time and overridden methods at runtime. Trace two complete programs, common traps and practice targets.

Updated 22 Oct 20266 min readJava

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.

Updated 18 Oct 20265 min readJava

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.

Updated 14 Oct 20265 min readJava

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.

Updated 10 Oct 20266 min readJava

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.

Updated 6 Oct 20266 min readJava

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.

Updated 1 Oct 20265 min readJava

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.

Updated 26 Sep 20266 min readJava

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.

Updated 24 Sep 20265 min readJava

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.

Updated 23 Sep 20265 min readJava

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.

Updated 22 Sep 20266 min readJava

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.

Updated 21 Sep 20266 min readJava

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.

Updated 19 Sep 20266 min readJava