JDK-8314446 : Release Note: String Templates (Preview)
  • Type: Sub-task
  • Component: specification
  • Sub-Component: language
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-08-16
  • Updated: 2023-08-29
  • Resolved: 2023-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21Resolved
Description
String templates allow text and expressions to be composed without using the `+` operator. The result is often a string, but can also be an object of another type. Each string template has a template processor that validates the text and expressions before composing them, achieving greater safety than basic 'string interpolation' features in other languages.
Comments
Rather than reiterating the JEP summary, I recommend "meeting readers where they are", which is on a journey looking for string interpolation: "String templates allow text and expressions to be composed without using the `+` operator. The result is often a string, but can also be an object of another type. Each string template has a template processor that validates the text and expressions before composing them, achieving greater safety than basic 'string interpolation' features in other languages."
16-08-2023