r/programming • • May 10 '18

Java: Executing code in comments?!

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

84 comments sorted by

View all comments

-5

u/pdp10 May 10 '18
/*
 * Always better.
 */

2

u/gurenkagurenda May 11 '18

I think you're saying this will prevent the issue. It won't. You can just use unicode escapes to terminate the block comment, then use more to start a new one.

2

u/recursive May 11 '18
/*
 * blah blah blah
 * \u002a\u002f System.out.println("gotcha"); \u002f\u002a
 * even more something
 */