Concatenating and printing text, integer, and boolean values

Report a typo

Given the skeletal structure of a basic Java program, fill in the blanks to print a concatenated message containing a textual greeting, followed by a number, and a boolean value. The string representation of each of these values must be stored in their respective variables before concatenation. The number should be 100 and the boolean should be 'true'. Use the valueOf method to convert the non-string literals into strings.

Fill in the gaps with the relevant elements
 class Main {
    public static void ([] args) {
        String hello = "Hello, World!";
        String number = String.valueOf(100);
        String booleanLiteral = String.valueOf(true);
        (hello + " " + number + " " + booleanLiteral);
    }
}
StringSystem.out.printlnmainpublic

Create a free account to access the full topic