Skip to main content

String Templates (Preview)

Learn String Templates (Preview) (Java 21 Features, Java) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

1. Introduction String templates (preview in Java 21 and 22) embed expressions in strings, such as STR ."Hello \{name}", with processors that can validate or transform the result.

More lessons in Java 21 Features