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 2 of 109Using Java Collections.binarySearch on Sorted Lists
Learn how to use Java Collections.binarySearch correctly: sorted-list prerequisites, return value semantics, comparator usage, and performance tradeoffs.
Java Compile Time vs Runtime Polymorphism
Understand Java compile-time polymorphism via method overloading, runtime polymorphism via method overriding, and the practical differences in binding and API design.
Java Reference Type vs Primitive Type in Practice
Understand how Java primitive and reference types differ in assignment, equality, null handling, memory cost, and when each type is the right choice.
Java Mutable vs Immutable: When to Use Each
Learn how mutable and immutable objects differ in Java, including thread-safety and allocation tradeoffs, and when to choose each approach.
Java Duration vs Period: When to Use Each
Java Duration vs Period explained: one measures fixed seconds for timeouts, the other counts calendar days and months. Examples and common pitfalls.
Java LocalDate vs LocalDateTime: When to Use Each
Compare Java's LocalDate and LocalDateTime types, learn when each is the right choice, and see how to convert between them with Java examples.
Java Future vs CompletableFuture: When to Use Which
java future vs completablefuture: Compare Java Future and CompletableFuture: blocking behavior, composition, error handling, and when each API fits your async workflow.
java synchronized vs volatile: Choosing the Right Concurrency Tool
java synchronized vs volatile: Understand the differences between synchronized and volatile in Java: memory visibility, atomicity, performance, and when to use each.
Java Runnable vs Callable: Key Differences
java runnable vs callable: Understand the differences between Java's Runnable and Callable interfaces, including return values, exception handling, and usage with Exec...
Java Lambda vs Method Reference: Choosing the Right Syntax
Compare Java lambda expressions and method references, understand their syntax differences, and learn when each style improves readability and maintainability.