logo CodeStepByStep logo

PrintProgram

Language/Type: Java basics println

Write a complete Java program in a class named PrintProgram whose output is the text that would be the source code of a Java program named Hello that prints "Hello, world!" as its output:

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

Your program must produce exactly the output shown in order to pass (using exactly four spaces for each increment of indentation in the output).

Class: Write a complete Java class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.