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 56 of 109Java List vs Set: When to Use Each Collection
Understand the behavioral differences between Java List and Set, including order, duplicates, implementations, conversion, and performance tradeoffs.
Java List get: Usage, Performance, and Edge Cases
java list get: Learn how to use Java List.get, what it costs on different implementations, and how to avoid IndexOutOfBoundsException.
Java List Remove: Methods, Pitfalls, and Performance
java list remove: Learn how to remove elements from a Java List using index, object, removeAll, and removeIf, and avoid common pitfalls like ConcurrentModificationExce...
Java List Add: Methods, Behavior, and Performance
Learn how to add elements to a Java List using add(), addAll(), and index-based insertion, and understand the behavior and performance of ArrayList and LinkedList.
Java List Methods: A Practical Guide
Explore the core methods of Java's List interface, their behavior, and how to choose between ArrayList and LinkedList for your use case.
Java List Interface: Contract and Implementations
Learn the Java List interface, its core methods, and how to choose between ArrayList and LinkedList for your use case.
Using Java LinkedList as a Stack
Learn how to use Java's LinkedList as a stack, including push/pop operations, performance tradeoffs, and how it compares with the legacy Stack class.
Java LinkedList as Queue: Implementation and Tradeoffs
Learn how to use Java's LinkedList as a queue, including FIFO behavior, offer/poll/peek methods, thread-safety considerations, and when ArrayDeque is usually the better choice.
Java LinkedList push pop: Stack Operations Explained
Learn how push and pop work on Java's LinkedList through the Deque interface, with code examples, performance tradeoffs, and comparisons to ArrayDeque.
Java LinkedList poll: How It Works
Understand how LinkedList.poll() works in Java: what it removes, what it returns on empty lists, and how it compares with remove(), peek(), and ArrayDeque.