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–2011, Robert Sedgewick and Kevin Wayne.
Last updated: Tue Aug 30 09:58:33 EDT 2016.