5 ms·
But that's not really surprising, it's each character as a unicode escape (see section 3.2 of the Java spec). It's possible in any language that allows escaped
by danieldk 10y ago
But that's not really surprising, it's each character as a unicode escape (see section 3.2 of the Java spec). It's possible in any language that allows escaped code points.
- 0xmohit 10y agoNot surprising, yes. But what is silly is that the Unicode sequences are also interpreted in comments. /* Comment region begins. \u002a\u002f String s = "Comment was closed in the previous statement";
- flukus 10y agoThat's a recipe for pure evil.
- ygra 10y agoMost languages only tend to allow them in string literals, or identifiers. Java is fairly unique in that it has a pre-processor that replaces those throughout the source code before actually compiling. Which means that a lot of benign-looking source code can have fairly surprising behaviour, such as exhibited in the polyglot where //\u000Afoo actually cancels the line comment.
- 0xfeba 10y agoOh man, if I had known that at my last job I could have had great fun with some of coworkers via my commits.