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

    IO.println(word.length());
    IO.println(word.charAt(0));
    IO.println(word.charAt(word.length() - 1));
    IO.println(word.substring(0, 3));
    IO.println(word.substring(1));

    String reversed = "";
    for (int i = word.length() - 1; i >= 0; i--) {
        reversed += word.charAt(i);
    }
    IO.println(reversed);
}

// From Groundwork, chapter 8 (ch08-strings-as-data), box 1.
// This example is from Groundwork, licensed CC BY-NC-SA 4.0.
// Run with: java ch08_01.java
