TenHelloWorlds.java


Below is the syntax highlighted version of TenHelloWorlds.java from §1.1 Hello World.


/******************************************************************************
 *  Compilation:  javac TenHelloWorlds.java
 *  Execution:    java TenHelloWorlds
 *
 *  Prints "Hello, World" ten times. You'll learn about a more
 *  compact way to do this in Section 1.3 when we introduce loops.
 *
 *  % java TenHelloWorlds
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *  Hello, World
 *
 ******************************************************************************/

public class TenHelloWorlds {

    public static void main(String[] args) {
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
        System.out.println("Hello, World");
    }

}


Copyright © 2000–2017, Robert Sedgewick and Kevin Wayne.
Last updated: Fri Oct 20 14:12:12 EDT 2017.