Complete the code for a greeting and year display

Report a typo

You have created a basic greeting program in Java that displays a message "Hello, World!" and the current year. However, some parts of your Java program are missing. Your task is to correctly fill the blanks in your code to ensure it prints the supplied greeting and combines it with a statement welcoming the user to the current year.

Fill in the gaps with the relevant elements
  HelloWorld {
    public static void main(String[] args) {
        String greeting = "Hello, World! Learn programming with us!";

        (greeting);
    }
}
publicSystem.out.printlnclass
___

Create a free account to access the full topic