Using a text block

Report a typo

Consider the following code:

String employee = "first name:\n"
    + "last name:\n"
    + "post:\n"
    + "age:\n"
    + "id:\n";

We want to replace the example with a similar one using a text block. Select the letter corresponding to the correct code snippet.

a)

String employee = """first name:
    last name:
    post:
    age:
    id:""";

b)

String employee = """
    first name:\nlast name:\npost:\nage:\nid:""";

c)

String employee = """
    first name:
    last name: 
    post:
    age:
    id:""";

d)

String employee = """
    first name:
    last name: 
    post:
    age:
    id:
    """;
Select one option from the list
___

Create a free account to access the full topic