---
title: "Java: Loops"
date: 2015-01-01
description: "Eclipse example: loops Java has three kinds of loops: **while loop** ```java while (condition) { // run } ``` **do...while loop** ```java do { // run } while(condition); ``` {%..."
canonical_url: https://idratherbewriting.com/java-loops/index.html
---

> For AI agents: a documentation index is available at https://idratherbewriting.com/llms.txt. Markdown versions of all pages are available by appending .md to any page URL.

# Java: Loops

Eclipse example: loops

Java has three kinds of loops:

**while loop**

```java
while (condition) {
// run
}
```

**do…while loop**

```java
do {
// run
}
while(condition);
```

**for Loop**

```java
for(counter initial value, condition, post loop action)
```
