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

48

u/flaghacker_ May 10 '18

Isn't this just a chapter completely ripped from the Java Puzzlers book?

2

u/duckvimes_ May 11 '18

There are many gotchas on this theme and Java Puzzlers by Joshua Bloch and Neal Gafter included the following variant

1

u/flaghacker_ May 11 '18

Looks like that and the quote blocks were edited in after the fact.