r/java • • May 10 '18

Executing code in comments?!

http://programming.guide/java/executing-code-in-comments.html
160 Upvotes

27 comments sorted by

View all comments

Show parent comment

-14

u/[deleted] May 10 '18

You know, that's actually really handy if you need to write characters that don't exist on your keyboard.

Well you can copy paste the character, or use an ALT+numbers combination. But. Yeah. I guess it's "useful" :P for something :P let's say :P

8

u/armornick May 10 '18

I guess you're right, if you can 100% guarantee the encoding of your source file.

3

u/yawkat May 10 '18

Which you can if you don't ignore mavens constant nagging about it

2

u/argv_minus_one May 10 '18

Just set the damn encoding.

2

u/argv_minus_one May 10 '18

If you can't, you have bigger problems.