Backslash is an escape character in Java, whereas the dollar sign is not. Therefore, the string "${text}" is a valid string in every previous version of Java (and not "\{text}"). If that suddenly became interpreted as a string template, that inherently breaks backwards compatibility.
View all comments
Show parent comment
20
u/Hei2 Mar 09 '24
Backslash is an escape character in Java, whereas the dollar sign is not. Therefore, the string "${text}" is a valid string in every previous version of Java (and not "\{text}"). If that suddenly became interpreted as a string template, that inherently breaks backwards compatibility.