Update Dec. 2018 (12 months later):
Raw string literals (which are on the amber list) won't make it to JDK 12.
See the criticisms here.
There might be in a future version of Java (10 or more).
See JEPS 8196004 from January 2018: ("JEP" is the "JDK Enhancement Program")
JEP draft: Raw String Literals
Add a new kind of literal, a raw string literal, to the Java programming language.
Like the traditional string literal, a raw string literal produces a String, but does not interpret string escapes and can span multiple lines of source code.
So instead of:
Runtime.getRuntime().exec("\"C:\\Program Files\\foo\" bar");
String html = "<html>\n"
" <body>\n" +
" <p>Hello World.</p>\n" +
" </body>\n" +
"</html>\n";
System.out.println("this".matches("\\w\\w\\w\\w"));
You would be able to type:
Runtime.getRuntime().exec(`"C:\Program Files\foo" bar"`);
String html = `<html>
<body>
<p>Hello World.</p>
</body>
</html>
`;
System.out.println("this".matches(`\w\w\w\w`));
Neat!
But it is still just a draft: it will need to posted, submitted, be a candidate, and funded, before being completed and making it into the next JDK.
System.out.println(mapperObj.writeValueAsString(mapperObj.readValue(str, Object.class)));
– Clearly