void main() {
    String word = "banana";

    for (int i = 0; i < word.length(); i++) {
        if (word.charAt(i) == 'a') {
            IO.println("There is an a at position " + i + ".");
        }
    }
}

// From Groundwork, chapter 5 (ch05-repetition), box 8.
// This example is from Groundwork, licensed CC BY-NC-SA 4.0.
// Run with: java ch05_08.java
