Java’s for each loop does not provide an iteration counter. There are a few ways we can iterate over both the item and its index.
Also find me here:
Baeldung Author
Ashley Frieze
I've been writing software since I was a kid, and have been doing it professionally since the days of dial-up internet. These days I'm a consultant, helping teams with full stack cloud projects in Java and TypeScript. When I'm not software engineering, I can be found performing as a stand-up comedian, or in musical theater.
Here's what I've written (so far):
Baeldung on Java
- All
- Testing (4)
- Web Services (1)
- Spring (1)
- Logging (1)
- Java String (1)
- Java IO (1)
- Java Collections (1)
- Java (1)
- Jackson (1)
- JSON (1)
- Core Java (1)
- Cloud (1)
- Algorithms (1)
How to Use Regular Expressions to Replace Tokens in Strings in Java
Filed under Algorithms, Java
Learn some regular expression strategies for replacing tokens in strings
Guide to Java BiFunction Interface
Filed under Core Java
Learn some common patterns for Java functional interfaces that take two parameters.