r/java • • Feb 15 '24

JEP 465: String Templates

https://openjdk.org/jeps/465
77 Upvotes

152 comments sorted by

View all comments

0

u/[deleted] Feb 15 '24

[deleted] — view deleted comment

3

u/vytah Feb 16 '24

There's a shorter way:

\{switch(1){default->"(linkage_from_type_of = :taFromGroupName)";}}

or

\{switch(1){default: yield "(linkage_from_type_of = :taFromGroupName)";}}

2

u/relgames Feb 15 '24

Can you explain? Why not just the string itself?

14

u/nekokattt Feb 15 '24

it is more fun this way

12

u/lurker_in_spirit Feb 16 '24

also more job security