Text block indentation and newlines

Report a typo

What will the output be for the following code? Select the letter corresponding to the correct code snippet.

String textBlock = """
                   Hello world
                       Goodbye world""";


String reply = "The world did not reply, but one of its oceans waved.";

System.out.println(textBlock + reply);

A)
Hello world
    Goodbye worldThe world did not reply, but one of its oceans waved.
B)
Hello world
Goodbye world
The world did not reply, but one of its oceans waved.
C)
Hello world Goodbye world
The world did not reply, but one of its oceans waved.
D)
Hello world    Goodbye worldThe world did not reply, but one of its oceans waved.
Select one option from the list
___

Create a free account to access the full topic