The Baeldung logo
  • The Baeldung Logo
  • Back to Baeldung
  • Pricing
  • Courses
  • Team Courses
    • Login
    • Registration

Learn New Java Features – Module 2 Lesson 2- Quiz

Last updated: December 8, 2025

Written by: komal
  1. Learn What’s New in Java
  2. Lesson 2: Multi-line Strings with Text Blocks
  3. Learn New Java Features – Module 2 Lesson 2- Quiz
Time limit: 0

Quiz Summary

0 of 5 Questions completed

Questions:

Information

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading…

You must sign in or sign up to start the quiz.

You must first complete the following:

Results

Quiz complete. Results are being recorded.

Results

0 of 5 Questions answered correctly

Time has elapsed

You have reached 0 of 0 point(s), (0)

Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)

Categories

  1. Not categorized 0%
  1. Review
  2. Answered
  3. Correct
  4. Incorrect
  1. Question 1 of 5
    1. Question

    Which syntax is used to define a Text Block in Java (starting from Java 15)?

    Correct
    Incorrect
  2. Question 2 of 5
    2. Question

    In a Text Block, how does the compiler determine “incidental whitespace” (the indentation to be removed)?

    Correct
    Incorrect
  3. Question 3 of 5
    3. Question

    We are writing a very long SQL query inside a Text Block and want to break it into multiple lines in your source code for readability, but you want the resulting String to be a single long line (no newlines). Which escape sequence should we use at the end of the line?

    Correct
    Incorrect
  4. Question 4 of 5
    4. Question

    Java Text Blocks automatically strip trailing whitespace from lines. If we specifically need to preserve a space at the end of a line, which escape sequence should we use?

    Correct
    Incorrect
  5. Question 5 of 5
    5. Question

    If we move the closing “”” delimiters to the left (further left than the content of the block), what happens to the resulting String?

    Correct
    Incorrect
The Baeldung logo

Courses

  • Baeldung All Access
  • Individual Courses
  • Baeldung All Team Access
  • Login Course Platform

Pro

  • Pro Team Package
  • FAQ

About

  • About Baeldung
  • The Full Archive
  • Editors
  • Our Partners
  • Partner with Baeldung
  • eBooks
  • FAQ
  • Baeldung Pro
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo