Completing a simple 'Hello, World!' program

Report a typo

You're asked to complete a simple Java program based on the object-oriented programming principles you've learned. The program is designed to print a custom "Hello, world!" message. To do this, a class named 'HelloWorld' has been created, however, the code is not complete. Fill the blanks to properly define the 'HelloWorld' class, instantiate an object of it, and call its getMessage method to print the 'Hello, world!' message.

Fill in the gaps with the relevant elements
 HelloWorld {
     String message;

    public HelloWorld(String message) {
        this.message = message;
    }

    public String getMessage() {
        return this.message;
    }

    public static  main(String[] args) {
        HelloWorld helloWorld =  HelloWorld("Hello, world!");
        System.out.println(helloWorld.getMessage());
    }
}
public classnewvoidprivate
___

Create a free account to access the full topic