The Baeldung logo
  • The Baeldung Logo
  • Start Here
  • Spring Courses ▼▲
    • REST with Spring Boot

      The canonical reference for building a production grade API with Spring

    • Learn Spring Security ▼▲

      THE unique Spring Security education if you’re working with Java today

      • Learn Spring Security Core

        Focus on the Core of Spring Security 6

      • Learn Spring Security OAuth

        Focus on the new OAuth2 stack in Spring Security 6

    • Learn Spring

      From no experience to actually building stuff​

    • Learn Spring Data JPA

      The full guide to persistence with Spring Data JPA

  • Java Courses ▼▲
    • Learn JUnit

      Master the most popular Java testing framework.

    • Learn Maven

      Simplify Your Build with Apache Maven

    • Learn Hibernate JPA

      Master persistence with the Java specification and Hibernate implementation

    • Learn Mockito

      Enhance your unit tests through practical mocking

    • Learn JSON with Jackson

      Jackson can do a lot processing JSON used to its full capacity

  • Pricing
  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • Baeldung Ebooks

      Discover all of our eBooks

    • About Baeldung

      About Baeldung.

  • Category upJava Collections
  • Category upJava List
  • Category upJava Streams

Tag: Iteration

Looping through Java collections using iterators or loops is one of the most widely used operations. Learn how to iterate different Java collections safely and efficiently through the guides below.

>> Checking if an Element is the Last Element While Iterating Over an Array

>> Difference Between Iterator.forEachRemaining() and Iterable.forEach()

>> How to Iterate a List of Maps in Java

>> Get the Position of Key/Value in LinkedHashMap Using Its Key

>> Iterator vs forEach() in Java

>> Adding Elements to a Collection During Iteration

>> Simplified Array Operations on JsonNode Without Typecasting in Jackson

>> Reset ListIterator to First Element of the List in Java

>> PriorityQueue iterator() Method in Java

>> Comparison of for Loops and Iterators

>> Detect the Last Iteration in for Loops in Java

>> Modifying Objects Within Stream While Iterating

>> How to Get First or Last Entry From a LinkedHashMap in Java

>> How to Iterate Over the String Characters in Java

>> Skipping the First Iteration in Java

>> How to Get First Item From a Java Set

>> What’s the Difference Between Iterator and ListIterator?

>> Convert Java Array to Iterable

>> Creating Custom Iterator in Java

>> Combining Two Lists Into a Map in Java

  • ↑ Back to Top
  • 1
  • 2
  • Next →
The Baeldung logo

Courses

  • All Courses
  • Baeldung All Access
  • Baeldung All Team Access
  • The Courses Platform

Series

  • Java “Back to Basics” Tutorial
  • Learn Spring Boot Series
  • Spring Tutorial
  • Get Started with Java
  • All About String in Java
  • Security with Spring
  • Java Collections

About

  • About Baeldung
  • The Full Archive
  • Editors
  • Our Partners
  • Partner with Baeldung
  • eBooks
  • FAQ
  • Baeldung Pro
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo