Completing a greeting message code

Report a typo

John wants to introduce himself to new users of his programming game. He has written some code that should display his name and age in the console. However, some important parts are missing. Can you help him out by filling the blanks in the code that constructs and prints a greeting message containing his name and his age?

Fill in the gaps with the relevant elements
  Main {
    public static void (String[] args) {
        String name = "John Doe";
        int age = 30;
        ("Hello, my name is " + name + " and I am " + age + " years old.");
    }
}
methodclasspublicSystem.out.printfinterfaceSystem.out.printlnprivatemain
___

Create a free account to access the full topic